NameSilo

Clean URLs with PHP how do you do this?

Spaceship Spaceship
Watch

fro0ty

Established Member
Impact
1
0
•••
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
•••
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
•••
Well, unless the content is dynamic I guess it would work.. clever!
 
0
•••
Its done with mod_rewrite,

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

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule contact/$ /contact.php
 
0
•••
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
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back