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

    I set up my site quite hierarchical in structure; many of my pages are three directories deep, and it could go deeper if I continue down the same track. If I understand correctly, I could keep the (menu) structure for the visitors, just have the pages with only one slash in the URL (via the option in the manager), and Google et al will be happier - is that correct? In which case, I need to set up a lot of redirects for my existing pages.

    I tried a redirect last night for mysite.com/home >> mysite.com, and had problems. In the end I used the SEO Strict URLs plugin to reslove the situation. I was using the commonly stated permanant redirect method in the .htaccess file:

    redirect permanent /oldpage http://www.mysite.com/newpage.

    No matter what I tried, it would either not work, or cause an internal error.

    # Added redirct rules
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mysite\.com [nc]
    RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
    
    
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    


    The above is from my .htaccess file. If I use the above syntax instead, will that be interpreted as a 301 redirect? If so, how would I write a rule to change the following:

    www.mysite.com/animals/cats/tabby >> www.mysite.com/tabby.

    Is there any problem with a lot of rules appearing in the .htaccess file. I guess I have two or three dozen pages that will need redirecting.

    Thanks.
      • 20289
      • 958 Posts
      Am i right?, you tried to move your MODx files from subdirectory to the root, and now you’ve got a problem...?
        [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
        [td][Wiki] [Persian support forum]
        [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
        [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
        • 37272
        • 216 Posts
        No, you are not right! grin

        I intend to move away from ’freindly alias path’, so that all my main pages are in the root - I have not yet done this. When I do so, I will need premanent redirects in place, so that I don’t loose the rankings on my pages. I need a method that works, because as I pointed out ’/old-parent/old-child http:www.mysite.com/new-chlid’ does not work when placed in that .htaccess file.

        Thanks.
          • 20289
          • 958 Posts
          This might help you as im not sure about various .htaccess file syntax or mod_rewrite. BTW consider this w3c advice smiley
            [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
            [td][Wiki] [Persian support forum]
            [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
            [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
            • 37272
            • 216 Posts
            Thanks MotSmart.

            That page linked to another with just what I need to set up those 301s.
              • 20289
              • 958 Posts
              Quote from: Colin at Sep 04, 2007, 05:57 PM

              Thanks MotSmart.

              That page linked to another with just what I need to set up those 301s.

              Great, so if you get it to work just mention the way you have done, so this might be useful to others someday smiley
                [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                [td][Wiki] [Persian support forum]
                [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]