Hello, I'm trying to redirect domain.com/test domain.com/TEst domain.com/test.html domain.com/test22 domain.com/TEST.php to domain.com/test.html . So the redirect should work for all urls that start with test, case insensitive. What I have now : === RewriteCond %{HTTP_HOST} ^domain.com$ [OR,NC] RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC] RewriteRule ^test(.+).\html$ "http\:\/\/www\.domain\.com\/test\.html" [R=301,L] I tried many things, but I can't make it working as I want. Thank you.
You're kind of not making sense. Do you want to redirect domain1.com/test.php (or whatever) to domain2.com/test.html? Because you mention you want everything redirecting to domain.com/test.html but also include domain.com/text.html as an example of what you want to redirect. Very odd. Anyway: RewriteEngine On RewriteCond %{REQUEST_URI} !^/test.html [NC] RewriteCond %{REQUEST_URI} ^/test(.*) [NC] RewriteRule (.*) [url]http://domain.com/test.html[/url] [R=301,L] Code (markup):
Hello Ryan, domain.com/test.html from the list is my mistake ... sorry. I tested it and is working great. I made one small modification. I removed the [NC] from the first line , so it can process urls like domain.com/TesT.html So it looks now like : RewriteEngine On RewriteCond %{REQUEST_URI} !^/test.html RewriteCond %{REQUEST_URI} ^/test(.*) [NC] RewriteRule (.*) [url]http://domain.com/test.html[/url] [R=301,L] Code (markup): Thank you very much for the help.