I recently completed a site changeover for one of my clients from all ASP to
all PHP. To ensure that the Search Engine results were not lost, I left the
ASP pages up on the site during the transition.

All that remains is to write an htaccess file to handle the mod_rewrite
statements. I want to mark them as a 301 permanent redirect, but I am new to
regex and having tons of trouble with the actual REWRITE X to Y part.

The logic is this:
If the requested file name on TheDomain.org has a file extension of "asp"
(whether or not it contains anything afterwards such as ?id=foo), rewrite
the path to the same filename, change the extension to "php", and add back
in anything after the extension if it exists.

In other words, if the request is for:
/articles/article.asp?aid=1
Change it to:
/articles/article.php?aid=1

I need to handle the root directory, any subdirectories, a subdomain, and
file names with and without a querystring. Case is also an issue since this
is a Linux server.

I can get it to work when I code it to switch a single file name, but I
can't get it to work with a regex, so I know the problem is not my
"htaccess" skills but rather my regex skills.

Can anyone help?

Susan Davis


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to