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 ?
Asked
Active
Viewed 2,591 times
2 Answers
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.