Page 1 of 1

Make links look like this: ".com/login/"

Posted: Tue Jul 08, 2008 2:42 pm
by JakkyD
Hi. I was wondering how sites make links look like this ".com/login/"

Now, I was thinking that there could be mulitple folders, but, as it goes straight to ".com/login/" it must need an index, but it hasnt.

Silly question but thanks :P

Re: Make links look like this: ".com/login/"

Posted: Wed Jul 09, 2008 6:52 pm
by Ollie Saunders
Depends on the server running. If it's apache you can easily use mod_rewrite. A common technique is to route all requests to one particular PHP file:

Code: Select all

RewriteEngine On
RewriteRule .* index.php
You can then use logic to branch application flow in whichever ways you require by examining $_SERVER['REQUEST_URI']