Forum Moderators: phranque
[mysite.com...]
What I would like to be able to do is this;
[mysite.com...]
Basically removing "method="
Using this rule;
RewriteEngine On
#rewrite all old URIs with the method
RewriteRule ^(.*)\.php?method=(.*)$ /$1.php?$2 [R=301,L]
When I navigate to the new url (http://www.mysite.com/index.php?A_File_Name) I am automatically redirected to my home page of my site.
My home page exists as;
[mysite.com...]
[mysite.com...]
What do I have to do to keep from being redirected to my home page?
My follow symlink is enabled, mod re-write is enabled, and all other things are in place.
The reason I want to keep the index.php? instead of turning the page into a .html is because I have good pagerank for any of my pages that start with the index.php?method=File_Name
Does anyone see a workaround for this?
I'm afraid this is backwards. Change your script to produce URLs like "http://www.mysite.com/index.php?A_File_Name"
and then use mod_rewrite to change those requests back to "/index.php?method=A_File_Name" when they are received from clients and search spiders. In this way, clients and search spiders see the shorter URL, and mod_rewrite changes it back to the form needed to call your script.
Mod_rewrite works after a request is received, and before any content is served or any scripts are activated. That is, it changes input URLs, not output URLs.
Jim