regex - %{REQUEST_URI} doesn't seem to work with index.php -
I have a website that uses the following format of the link:
http : //www.website.com/section1/index.php http://www.website.com/section2/index.php http://www.website.com/section3/index.php http: // www. Website.com /section1/section4/index.php What I was trying to do to get rid of "index.php" by using the following .htaccess instructions: Rewind sound revived on% {REQUEST_URI} ^ / index.php $ RewriteRule (. *) Http://www.google.com [R = 301, NC, L] Of course, www.google.com only angel Although the example below Shn The objectives are not working. What's wrong in this? The second part of the question will I replace www.google.com with it if I want to rewrite it?
Thank you!
This is not working because your regex is incorrect revoked code% {REQUEST_URI} ^ / index \ .php $ % {REQUEST_URI} is expected /index.php you have /section1/index.php . The correct version will be: Rewrite engine on rewriting% {REQUEST_URI} /index.php$RewriteRule (. *) HTTP://www.google.com [R] = 301, NC, L] or even:
RewriteEngine at $ .php $ http: // www. google.com [R = 301, NC, L]
Comments
Post a Comment