NYCPHP Meetup

NYPHP.org

[nycphp-talk] Related to "How to create custom URLs"

Rob Marscher rmarscher at beaffinitive.com
Mon Mar 19 19:09:05 EDT 2007


On Mar 19, 2007, at 12:28 PM, tedd wrote:
> [1] http://sperling.com/contact
> instead of the new:
> [2] http://sperling.com/contact.php
> How can I get the url displayed to look like number [1] regardless  
> if the user adds ".php" or not?

I was messing around with it and it seems the only way to get it to  
work without causing a circular redirect is to put your php code in a  
file named contact (without the .php) and get apache to process that  
with php -- I forget how to do this but seem to remember someone  
posting it on the list last summer.  Then you can have almost the  
opposite rule of what you currently have:
RewriteRule ^contact.php$ /contact [R]




More information about the talk mailing list