PDA

Click to See Complete Forum and Search --> : PHP URL rewrite to root directory


neicedover1982
Apr 17th, 2008, 10:12 AM
Hi all, I am not sure if this is possible but I figured I would ask people who know PHP much better then me.

I have a PHP site that I plan to use SEO friendly URLs. I would really like it so that no matter what the URL is, the server serves the index.php file from the root folder.

like ..."http://mysite.com/home/about/hobbies/programing.php" and "http://mysite.com/about/myself/details.php" all go to the same PHP page in the root folder.

is there special character sor soemthing I can put in the URL like ".com/../home" that I can write. then I can have my index.php pull apart the url and build the page using all the smaller templates.

Thanks

penagate
Apr 17th, 2008, 08:50 PM
That is a good strategy.

.htaccess:
RewriteEngine On
RewriteRule ^(.*)$ index.php [L,QSA]

Alter the index.php path to be relative to where the .htaccess file is.