Redirect old URL with .htaccess?
-
There are many old links in the internet to our homepage. This links follow on a path structure form the former CMS. Now we like to redirect some of the most important old URLs to the new path.
So fare no problem, if the old URLs wouldn’t include/index.php?...
It conflicts with WP rewrite rule in .htaccess.E.g:
https://www.domain.com/index.php?task=listcats&cat_id=99&Itemid=52&option=com_mtree
should redirect tohttps://www.domain.com/information/about-us/
We like to send a 301 status code as well.
How can I create a rewrite rules/redirects in .htaccess, without disturb the existing rewrite rules of WP and other existing?
The existing and well working .htaccess looks like:
`# enforce https
<IfModule mod_rewrite.c>
RewriteEngine OnRewriteCond %{HTTPS} =off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
# deny acces to /xmlrpc.php
<Files xmlrpc.php>
Order allow,deny
Deny from all
</Files>`
- The topic ‘Redirect old URL with .htaccess?’ is closed to new replies.