2

If I have site www.mysite.com and then I have folder apache/htdocs as public folder in my server. I would like to have all requests made to www.mysite.com be assigned to index.php file. Is that possble or do I have to have folders if I want to have urls like www.mysite.com/about/ ? And how can I access path information in PHP code ?

newbie
  • 24,286
  • 80
  • 201
  • 301
  • 1
    possible duplicate of [Create a Catch-All Handler in PHP?](http://stackoverflow.com/questions/5218213/create-a-catch-all-handler-in-php) – mario Sep 02 '11 at 09:04

2 Answers2

1

no you use something called mod_rewrite to achieve the desired effect, there is diffrent regex depending on how your requests look like http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

what it does is basically if you have a url that looks like this url.com/index.php?page=about make it look like url.com/about/ but backend the request is just the same you could make it work anyway u want depends on the rules you apply to your mod_rewrite

Breezer
  • 10,410
  • 6
  • 29
  • 50
1

Use mod_rewrite.

See http://www.workingwith.me.uk/blog/software/open_source/apache/mod_rewriting_an_entire_site for a complete example.

This should work for you.