We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19734
    • 0 Posts
    Hi,

    I am having hassles with my friendly url. I have been hunting for a solution everywhere and really need some help.

    I have installed older versions of modx numerous times, but am having problems this time with v 2.1.1-pl traditional.

    Quick rundown of what I have done and what has happened...

    1. I changed my system settings to the attached.

    2. When previewing a page I get the correct friendly url.
    (eg http://www.domain.co.uk/about.html - for the page that is titled About us)

    3. After changing the .htaccess to the below things go a little wrong and I can’t clear my site cache and get a "500 - An Error Has Occurred. Please Check Your Scripts" error and can’t access any pages or the modx Manager.


    # Friendly URLs Part
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    # Force all pages to go to www.domain.com for SEO
    RewriteCond %{HTTP_HOST} !^www\.my-domain-was-here\.co.uk [NC]
    RewriteRule (.*) http://www.my-domain-was-here.co.uk/$1 [R=301,L]
    # Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    # Additional Settings Follow
    ExpiresActive On
    ExpiresByType image/gif A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/png A2592000
    BrowserMatch "MSIE" brokenvary=1
    BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
    BrowserMatch "Opera" !brokenvary
    SetEnvIf brokenvary 1 force-no-vary


    When I take out the .htaccess, I can access my modx manager again.

    The index .php and .htaccess files are located at /www.domainname.co.uk/web/

    I have a phpinfo.php at http://www.domain.co.uk/phpinfo.php

    If you need me to provide any info, just shout.




    Mitch
      • 19302
      • 6 Posts
      quick question :

      http://www.ammatherapy.co.uk/newsite/ is the website? if all the files are in a folder called newsite, should it be RewriteBase / or rather : RewriteBase /newsite/ ?

      edit: scrap what i wrote - is mod_rewrite even installed?

      another quickedit - I’m going with rewrite base - check that that’s right laugh
        • 19734
        • 0 Posts
        Hi Michael, thanks for replying.

        That is a static version of the site. I am actually using a .htaccess to redirect to that subdirectory temporarily untill I install modx so they have something up. I wasn’t going to change over the .htaccess files for the friendly urls for modx till I got everything up and running, but I thought I would test it out before I got started, as I know some folks have had problems in the past with furls.

        It’s only a small site, and I only wanted extremely limited content management for the user.

        I know it is not ideal.
          • 19734
          • 0 Posts
          Quote from: michaelm at Jun 21, 2011, 06:09 PM

          another quickedit - I’m going with rewrite base - check that that’s right laugh

          That is the static site.

          The modx install is at index .php and .htaccess files are located at /www.domainname.co.uk/web/

          See attached for a snapshot of my ftp.
            • 19302
            • 6 Posts
            k, with you now.

            I’m still going with mod_rewrite tho (lol) - your furl settings in modx look pretty normal. I just cut n copied this from another site - can you check that mod_rewrite is actually working ok?

            .htaccess :

            RewriteEngine on
            RewriteRule test\.html http://www.google.com [R]
            


            and then in your browser :

            http://www.yoursite.com/test.html
            


            takes you to google?

            Just wanted to test that because a 500 error is sometimes a misconfigured server laugh
              • 19734
              • 0 Posts
              Yes mod_rewrite is working fine. I just used yours and it took me to google. (have changed it back to my redirect to the subfolder since)
                • 19302
                • 6 Posts
                sweet, next is to check step by step :

                RewriteEngine On
                RewriteBase /
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                


                leaving out the non .domain rewrite to www.domain , and the # Additional Settings Follow stuff.

                keep in mind, that if you think it’s the caching, you can manually clear the modx cache in /core/cache (by deleting the files in that folder). And, you should also check file permissions laugh (right user and permission)

                also, is there anything more specific in the logs?
                  • 19734
                  • 0 Posts
                  Well, when I copy and paste what you posted it takes me to the correct page... and seems fine.


                  What does this mean?
                    • 19302
                    • 6 Posts
                    It means you could probably try the next lot :

                    RewriteEngine On
                    RewriteBase /
                    
                    RewriteCond %{HTTP_HOST} !^www\.ammatherapy\.co.uk [NC]
                    RewriteRule (.*) http://www.ammatherapy.co.uk/$1 [R=301,L]
                    
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
                    


                    If that still works, and you need the rest of the .htaccess, you can try pasting that in, seeing if everything is still working - mibbe mod_expires is causing the issue?

                    Also, you could probably change the System Setting > Site > Site Name to something like ’Ammatherapy’ laugh


                      • 19734
                      • 0 Posts
                      Cool. Added a message in the content field since! I was actually looking into site naming when you posted! You da man!