Hey everyone. Hopefully I can explain this correctly.
I have some URL's which I would like to tidy up through URL reWriting. For instance, I have:
domain.com/index.php?page=1
domain.com/index.php?page=2
domain.com/index.php?page=3
domain.com/index.php?page=4 etc..
which I would like to be shown in the URL as:
domain.com/page/1
domain.com/page/2
domain.com/page/3
domain.com/page/4 etc..
Also a quick question: -Will the $_GET query's still be executed if the URL is rewritten?
Many thanks ahead of time. I have the modules enabled and the .htaccess is ready to go. i just need some direction. Thanks!
Add this to your .htaccess file:
The GET queries will always be executed. If the user types in
domain.com/index.php?page=3
, thenindex.php
will run. If they type indomain.com/page/3
, then mod_rewrite will convert it todomain.com/index.php?page=3
before passing it to PHP. Either way,index.php
is run.