We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24197
    • 21 Posts
    Hello.

    I am using the .htaccess file to redirect visitors from pages which have been moved from an existing domain to a new domain.

    Example:

    (www.olddomain.com) /blog/index.php/old-page-url/ www.newdomain.com/new-page-url

    I am using the correct format.

    It seems the default MODx rewrite rules for FURLS have appended index.php to the end of the domain name of redirected URLs - www.newdomain.comindex.php/new-page-url - like that.

    For pages which remained on the old domain, I worked around this by adding their document ID to the end of the new redirect. However, it has not worked for the off-site redirects.

    I need anything which will redirect traffic (and SE rank) to the new domain & pages. SEO-Strict-Urls, or anything else which may be available.

    I was unable to find a solution in similar threads.

    Any information you can offer is appreciated.

      • 21257 MODX Staff
      • 730 Posts
      If you could post your .htaccess file, or relevant portions of it with any sensitive data obscured, it might help track down the problem. It might be an issue with the flags on your 301 rules.

      Another way to accomplish this would be to turn the URLs on your old site into Weblink documents. You will need one Weblink document for each redirected URL, and you only have to specify the alias and the URL. Because I have never done this myself, I just tested it, and confirmed that
      a) if you type in the old document name as the alias, even if it has an extension that you don’t have configured in Friendly URLs, like page1.asp for example, MODx will still repond to the URL page1.asp and redirect it to your new URL
      b) MODx does a permanent redirect (whether or not you have the Strict URLs plugin or not, I tried both ways)
      c) a limitation to this method is that if your old URLs are in subdirectories, your Weblink documents have to be set up in the same heirarchy with "Use friendly alias path" turned on in the Friendly URLs tab of Config, ie. you cannot specify something like "directory1/page1.html" as an alias - the forward slash will actually get removed

        Mike Schell
        Lead Developer, MODX Cloud
        Email: [email protected]
        GitHub: https://github.com/netProphET/
        Twitter: @mkschell
        • 24197
        • 21 Posts
        Thanks for the help netProphET!

        I’ll post a snippet of the htaccess tonight..
          • 24197
          • 21 Posts
          I’ve identified the source of the primary problem:

          redirecting this:

          redirect 301 /blog/index.php http://www.newdomain.com

          was resulting in modx appending index.php to the end of www.newdomain.com - so www.newdomain.comindex.php.

          Now all relevant urls are redirecting from the old site to the new site; the only problem left is that the old url is being appended to the end of the new url after ?q=.

          Ex:

          http://www.newdomain.com/vacation-time-vs-increasing-demands?q=blog/index.php/vacation-time-vs-increasing-demands/

          It has not stopped the page from being displayed, but I wonder if this will confuse search engines?

          Thanks!
            • 21257 MODX Staff
            • 730 Posts
            That doesn’t sound like a great situation as far as the search engines go.
            I’d have to see what’s happening in the .htaccess file to try to solve it.
              Mike Schell
              Lead Developer, MODX Cloud
              Email: [email protected]
              GitHub: https://github.com/netProphET/
              Twitter: @mkschell