Clean URLs with PHP how do you do this?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

fro0ty

Established Member
Impact
1
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I believe you have to edit the .htaccess or something like that.. Not 100% sure.
 
0
Close
I would just make a new folder called contact, then rename contact.php to index.php so it loads when you go to /contact

Unless I'm missing something?

e39m5
 
0
Close
Well, unless the content is dynamic I guess it would work.. clever!
 
0
Close
Its done with mod_rewrite,

place this into your htaccess file (edit as needed).

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule contact/$ /contact.php
 
0
Close
you could always set error handler to a custom script that checks the existance of the file (taking off the last slash and adding .php) if it does not exist do a 404 if it does forward to it.

Although rmwebs code would be better.
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Search: choose where to search from the All tab
Open the search at the top of any page. On the All tab, the list next to the search box lets you choose where to search: everything, all...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back