apache - htaccess 301 redirect doesn't work -
live site- http://www.marchingmonk.com
i add 301 redirect on htaccess file doesn't not work. code-
redirect 301 /home http://www.marchingmonk.com
when click on "home" button of website, user not being redirected http://www.marchingmonk.com, user redirected http://www.marchingmonk.com/home, creating duplicate content issue. site created cms(i don't have knowledge on cms), want make redirection htaccess file not works.
any idea how fix issue.
full code of htaccess file-
#old php handler rewriteengine on rewritecond %{http_host} ^marchingmonk\.com$ rewriterule ^(.*) http://www.marchingmonk.com/$1 [r=301] rewritecond %{http_host} ^(www.)?marchingmonk.com$ rewriterule ^([^\.]+)/?$ index.php?id=$1 [qsa,l] redirectmatch 301 ^/home/?$ http://www.marchingmonk.com
you can use redirectmatch
regex capabilities:
rewriteengine on rewriterule ^home/?$ http://www.marchingmonk.com/? [l,nc,r=301] rewritecond %{http_host} ^marchingmonk\.com$ rewriterule ^(.*) http://www.%{http_host}/$1 [r=301,l] rewritecond %{http_host} ^(www\.)?marchingmonk\.com$ [nc] rewriterule ^([^.]+?)/?$ index.php?id=$1 [qsa,l]
Comments
Post a Comment