Results 1 to 2 of 2

Thread: PHP URL rewrite to root directory

  1. #1

    Thread Starter
    Fanatic Member neicedover1982's Avatar
    Join Date
    Jun 2005
    Posts
    566

    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
    Kevin | New England Iced Over | http://www.kevincawleyjr.com

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width