PHP URL rewrite to root directory
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
Re: PHP URL rewrite to root directory
That is a good strategy.
.htaccess:
Code:
RewriteEngine On
RewriteRule ^(.*)$ index.php [L,QSA]
Alter the index.php path to be relative to where the .htaccess file is.