Forum Moderators: phranque
I got my rewritten URL listed in google, but unfortunately i needed to change them
old url was: mydomain.co.uk/category_name/oldfilename.html
new url is: mydomain.co.uk/category_name/newfilename.html
Have added 301 RedirectMatch:
RedirectMatch 301 /(.*)/oldfilename.html [mydomain.co.uk...]
it works fine but it produces unnecessary string at the end of the URL, i.e.:
this mydomain.co.uk/category_name/oldfilename.html is redirected to:
mydomain.co.uk/category_name/newfilename.html?selcd=category_name
I would appreciate all the suggestions as i have spent few hours trying to get that sorted.
Thanks,
Luke
Here is my whole .htaccess file
AddType application/x-httpd-php .htm .html
Redirect 301 /index.php [mydomain.co.uk...]
RedirectMatch 301 /(.*)/oldfilename.html [mydomain.co.uk...]
rewriteEngine on
RewriteRule (.*).html /index.html?selcd=$1 [L]
This will avoid 'exposing' your internal URL-path.
If you use two different modules, then you cannot control the order of execution, since Apache decides which module to run first, and that module will parse your code and execute all the directives it understands, before the other module processes any of the directives that it understands.
In other words, you can control the order of execution only of directives processed by the same module. Apache decides which module's directives are processed first.
This is controlled by the reverse LoadModule order in Apache 1.x, and by a module priority scheme in Apache 2.x, but the effect is the same from the viewpoint of .htaccess directive execution.
Jim