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

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
JakkyD
Forum Newbie
Posts: 4
Joined: Tue Jul 08, 2008 2:37 pm

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

Post 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
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

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

Post 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']
Post Reply