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

    I have spent a few hours and I cant 301 my sites urls, for example:

    http://mysite.com/index.php?q=services.html

    to

    http://mysite.com/services.html

    I am using the latest EVO with freindly urls on which is great and works for the menu - but google still has the old url which is causing duplicate problems.

    I did manage to remove the index.php? part but that only leaves the q= which really just makes another url for google to index.

    Any ideas?


      • 22574
      • 181 Posts
      Someone on stackoverview gave me this:

      RewriteCond %{THE_REQUEST} \s/+index\.php\?q=([^\s&]+) [NC]
      RewriteRule ^ /%1? [R=302,L]

      Put it above the first rewrite engine on line.
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        You might want to install MetaX which defines the canonical url. The search engines should update and respect that address without the need for the .htaccess code in question.
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
          • 22574
          • 181 Posts
          Thanks AMD,

          MetaX sounds usefull. I did work out a quick way of doing that a few weeks ago. using: <link rel="canonical" href="[(site_url)][~[*id*]~]" />

          But as always google is quite slow, and I wast sure if they would permanently remove the old urls.

            • 1343 ☆ A M B ☆
            • 2,213 Posts
            Yes, they should update their index over time with the new addresses. Adding a sitemap and submitting it using Google Webmaster tools can also help.
              Patrick | Server Wrangler
              About Me: Website | Tweets |  MODX Hosting