We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1416
    • 75 Posts
    I have moved from a static site to a MODx installation, but the site had been up for many years, so a lot of links on the net still points to old documents which no longer exists.

    So I tried with Redirect 301, like this:

    redirect 301 /english.asp http://www.mysite.se/english.php


    but this doesn’t work, since it only produces a link like this:

    www.mysite.se/english.php?q=english.asp

    I guess it has something to do with this line:
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


    but I can’t delete it since it is needed for Friendly URLs part.

    How can I get around this problem?!?

    Cheers
    Amrit
      • 4310
      • 2,310 Posts
      Maybe try this rule
      RewriteRule ^/english.asp$ english.php [NC,R=301]

      Before this part
      # For Friendly URLs
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        • 1416
        • 75 Posts
        Good idea, but it doesn’t work at all. Now nothing happens, and no redirect occurs.
        Also tried below the part you suggested and it gave the same result.

        Any other ideas?

        Cheers
        Amrit
          • 20407
          • 82 Posts
          Bumping this topic, since I would also like to know how to do this...
            • 33968
            • 863 Posts
            I didn’t notice your post before but I’ve just solved a similar problem on my own site:

            Try adding this:
            RewriteRule ^english.asp$ http://www.mysite.se/english.php [R=301,L]


            Under this:
            RewriteCond %{HTTP_HOST} .
            RewriteCond %{HTTP_HOST} !^www\.mysite\.se [NC]
            RewriteRule (.*) http://www.mysite.se/$1 [R=301,L]