I have a virtual host called local.maalumaalu. In htaccess lot of 301 redirection rules are there. My problem is when I have a rule like
Redirect 301 /special-offers local.maalumaalu/special-offers.html
Then
local.maalumaalu/special-offers/free-child.html
is redirected to
local.maalumaalu/special-offers.htmlfree-child.html
which is 'page is not found'. Any suggestions?
Use RedirectMatch
instead of Redirect
. RedirectMatch
has regex
support:
RedirectMatch 301 ^/special-offers/?$ local.maalumaalu/special-offers.html
OR if you want to use mod_rewrite then:
RewriteEngine On
RewriteRule ^special-offers/?$ /local.maalumaalu/special-offers.html [L,R=301,NC]