bruno
asked on
Help w/ mod rewrite rule - asp to php
Hi folks
recently converted a site from asp to php. I'm keeping the same URL structure, which is like this:
index.php?id=page
I'd like a rewrite url that will simply take index.asp?id=page and send it to index.php?id=page. "page" is just an example...whatever is after ".asp" should be put after ".php"
Thanks
recently converted a site from asp to php. I'm keeping the same URL structure, which is like this:
index.php?id=page
I'd like a rewrite url that will simply take index.asp?id=page and send it to index.php?id=page. "page" is just an example...whatever is after ".asp" should be put after ".php"
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
they both seem to be close, but neither one is working....
if my domain is example.com, this is what they are doing.
www.example.com/index.asp?id=page
will redirect to:
http://www.example.com/home/example/example.com/index.php?id=page
which is technically the full path on the server...but i can't have that redirect happening for the user....
they both seem to be doing the same thing.
thanks
if my domain is example.com, this is what they are doing.
www.example.com/index.asp?id=page
will redirect to:
http://www.example.com/home/example/example.com/index.php?id=page
which is technically the full path on the server...but i can't have that redirect happening for the user....
they both seem to be doing the same thing.
thanks
ASKER
Ok, I found if i do this it works ok:
RewriteRule (.*)\.asp$ /$1.php [L,R=301]
but i assume that would only work in the root directory?
RewriteRule (.*)\.asp$ /$1.php [L,R=301]
but i assume that would only work in the root directory?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Just a note, I haven't changed anything. This is a brand new hosting account....so that must be the way it was set up.
That seems to work though, thank you.
That seems to work though, thank you.
> For some reason You have changed RewriteBase
It's my bad english. The default configuration sets RewriteBase to folder where .htaccess lives. It's changed on Your system.
It's my bad english. The default configuration sets RewriteBase to folder where .htaccess lives. It's changed on Your system.
ASKER