My boss doesn't like seeing the question mark in the url.
I explained how a querystring works but he's set in his ways.
I'd rather not create a bunch of folders with index files in each.
He doesn't want
http://www.example.com/?cat=one
http://www.example.com/?cat=two
Instead, he wants
http://www.example.com/one/
http://www.example.com/two/
Any way to do this?
PHP url querystring question
Moderator: General Moderators
-
eektech909
- Forum Commoner
- Posts: 34
- Joined: Fri Jun 09, 2006 3:59 pm
- Peter Anselmo
- Forum Commoner
- Posts: 58
- Joined: Wed Feb 27, 2008 7:22 pm
Re: PHP url querystring question
You can do it with Apache's mod_rewrite module. I'd suggest Googling it to get the whole rundown.
Re: PHP url querystring question
You can also do it in the .htaccess file
I'm pretty sure this will work
I'm pretty sure this will work
Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^/(.+) /?cat=$1
-
eektech909
- Forum Commoner
- Posts: 34
- Joined: Fri Jun 09, 2006 3:59 pm
Re: PHP url querystring question
I did some research and this is exactly what I am looking for. I contacted our hosting company about the .htaccess files.
I'm not very familiar with this.
Can I create an .htaccess file with this in it via text edit and drop it in the folder of the index.php?
I'm not very familiar with this.
Can I create an .htaccess file with this in it via text edit and drop it in the folder of the index.php?
- hawkenterprises
- Forum Commoner
- Posts: 54
- Joined: Thu Feb 28, 2008 9:56 pm
- Location: gresham,oregon
- Contact:
Re: PHP url querystring question
Believe it or not there is an entire website and community devoted to this question
http://www.modrewrite.com/
I will say this though, if you are going to be doing 100k+ rewrites apache mod all though fast will take it's toll in performance, I would recommend a file based or combination solution to reach alot of pages/traffic.
http://www.modrewrite.com/
I will say this though, if you are going to be doing 100k+ rewrites apache mod all though fast will take it's toll in performance, I would recommend a file based or combination solution to reach alot of pages/traffic.
-
eektech909
- Forum Commoner
- Posts: 34
- Joined: Fri Jun 09, 2006 3:59 pm
Re: PHP url querystring question
Alright...
We don't personally host the site, but I guess we're running an IIS server.
We had ISAPI_Rewrite 3 Installed
Here's what i'm trying to convert
http://www.exampled.com/download/?cat=one
I made a txt file with the above code and renamed it to .htaccess and uploaded it to the directory but its not working
???
We don't personally host the site, but I guess we're running an IIS server.
We had ISAPI_Rewrite 3 Installed
Here's what i'm trying to convert
http://www.exampled.com/download/?cat=one
I made a txt file with the above code and renamed it to .htaccess and uploaded it to the directory but its not working
???