Tag Info

Hot answers tagged

1

This should work for files of any extension: RewriteEngine on RewriteCond %{QUERY_STRING} ^/(.*\..*)$ RewriteRule ^index\.php$ http://www.newsite.com/%1? [L,R=301] Or to redirect the entire path and file request: RewriteEngine on RewriteCond %{QUERY_STRING} ^/(.*)(\..*)$ RewriteRule ^index\.php$ http://www.newsite.com/%1%2? [L,R=301]


1

I replicated your setup. There are two problems: I can't get the %20 in the rewrite URL to work. I can get the rule to work if I replace %20 with +. A plus sign should URL decode to a space the same way a %20 does, so it should be treated the same in your matchevent.php script. It was redirecting me to a bad relative path. If I change the redirect path ...


1

Assuming this is in the .htaccess in your document root, then you are almost there. You just seem to be missing the / (slash - directory separator) from the front of your destination URL (in the first example). RewriteEngine On RewriteRule ^somepage$ /abc/somepage.php [R=301,L] The slash (or whatever is the base URL) is automatically removed from the ...



Only top voted, non community-wiki answers of a minimum length are eligible