Tuesday, 15 May 2012

.htaccess - How to redirect only 2 pages? -


There are about 150 pages in my blog site and I only need to redirect 2 pages to any other website's pages. I do not need a rewrite rule but I only need to redirect these 2 pages.

I have tried this but it does not work:

  & lt; Ifmodule mod_rewrite.c & gt; RewriteEngine On RewriteRule http://www.site1.com/aaa.php http://www.site2.com/111.php [R = 301, L] & lt; / IfModule & gt; & Lt; IfModule mod_rewrite.c & gt; RewriteEngine On RewriteRule http://www.site1.com/bbb.php http://www.site2.com/222.php [R = 301, L] & lt; / IfModule & gt;   

Why?

The first logic path of the rewrite rule is URI

  & Lt; IfModule mod_rewrite.c & gt; RewriteEngine On RewriteRule ^ aaa .php $ http://www.site2.com/111.php [R = 301, L] Riveritium ^ BBB \ .php $ http://www.site2.com/222.php [R = 301, L] & lt; / IfModule & gt;    

No comments:

Post a Comment