0

Is there a way to redirect from a subdirectory on a webserver to a get request in php? What I would like is for visitors to be able to visit a subdirectory like: www.example.com/subdirectory, and have this redirected to or treated as www.example.com/page.php?id=subdirectory ...

I could of course create a script that writes a php file to the given subdirectory with something like: header("www.example.com/page.php?id=subdirectory"); but is there a way to do this without having to create new files for each new link? thanks.

Daniel Valland
  • 1,057
  • 4
  • 21
  • 45
  • If you use apache, a mod rewrite rule can do this. – Progrock May 10 '16 at 09:36
  • Possible duplicate of [How to make google search dynamic pages of my site](http://stackoverflow.com/questions/8201186/how-to-make-google-search-dynamic-pages-of-my-site) – clemens321 May 10 '16 at 09:37

0 Answers0