11-15-2008, 01:13 AM
|
#3 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
You don't necessarily need to get rid of the file from the string for instance
PHP Code:
<?php
function getURL( $num = 0 ) { $arURL = explode('/', $_SERVER['REQUEST_URI']); return ( isset( $arURL[$num + 1] )) ? $arURL[$num + 1] : false; }
?>
Going on, this might be an appealing way of circumventing some of the problems associated with mod_rewrite but let's say your system depends on modules ( as do many ) so that you're unfriendly url looks like so
index.php?mod=user&act=login
Your friendly-esk URL would look like so
index.php/mod/user/act/login
or
index.php/user/login
Using mod_rewrite you can achieve domain.com/login which looks still more appealing then any of the url's your method. I'm not trying to defame your attempt to come up with alternatives to mod_rewrite merely state that mod_rewrite is much more flexible and gives much more control for urls.
|
|
|
|