On the latest site I am working on I am using a single php file, which loads different data from the database based on the content of the $_GET['page'] tag.
Now obviously this results in URLs such as mysite.com/index.php?page=Contact-Us which is rather unattractive and not very efficient for search engines.
So what I would like is mysite.com/Contact-us to load the page mentioned above.
However if only life was that simple.
Contact-Us is simply one name of a page that exists right now, there are infact several and they will be constantly changing so the file will need to allow for this.
And just to make things even more complicated there is a directory called admin which needs to be accessible without the rewrite rule kicking in.
I have tried the following but it does not work, firstly the $_GET['page'] variable is index.php not Contact-Us.
Secondly it does not let mysite.com/admin access the admin directory.
Question
JTW
Hi,
On the latest site I am working on I am using a single php file, which loads different data from the database based on the content of the $_GET['page'] tag.
Now obviously this results in URLs such as mysite.com/index.php?page=Contact-Us which is rather unattractive and not very efficient for search engines.
So what I would like is mysite.com/Contact-us to load the page mentioned above.
However if only life was that simple.
Contact-Us is simply one name of a page that exists right now, there are infact several and they will be constantly changing so the file will need to allow for this.
And just to make things even more complicated there is a directory called admin which needs to be accessible without the rewrite rule kicking in.
I have tried the following but it does not work, firstly the $_GET['page'] variable is index.php not Contact-Us.
Secondly it does not let mysite.com/admin access the admin directory.
Any help on this would be much appreciated.
Joe
Link to comment
Share on other sites
8 answers to this question
Recommended Posts