We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3071
    • 99 Posts
    I already have modrewrite on my Apache server and my URLs are clean already - www.example.com/this-is-my-url
    I now need to 301 redirect all old URLs to new URLs after rebuilding a site and changing these but it simply won’t work! These have already been rewritten so this makes the process even more difficult I think?, there seems to be not a shred of information on the internet on how to do this. For example, I want to redirect:

    www.example.com/this-clean-url to this:
    www.example.com/this-new-clean-url

    It won’t work in the conventional way, as the one to be redirected already has stuff applied to it to rewrite, I think..
    Has anyone out there ever actually done this and can help by any chance?

    Thanks in advance for any pointers.

    Here’s my .htaccess file:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]