Forum Moderators: phranque

Message Too Old, No Replies

I have one query - Well a simple one for expert APACHE guy

         

thriller aus

7:34 pm on Mar 1, 2006 (gmt 0)

10+ Year Member



http://www.example.com/dir/category.php?cat=religion

this is my link and if i am writting for this one like
http://www.example.com/dir/category?cat=religion

It means i am retreiving the page without the extension but with the query string. So how can i retreive the value of this query string in my php pages. Plus i need to know the Apache code in .htaacess file for these strings.

I am only stuck with this query string. So i am hoping that moderator will solve my query with in a sec. rest of the files with url masking is done.

Apache is some thing new for me.

[edited by: jatar_k at 8:12 pm (utc) on Mar. 1, 2006]
[edit reason] examplified [/edit]

Birdman

10:19 pm on Mar 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not lose the query string completely?

http://www.example.com/dir/category_religion

.htaccess


RewriteEngine On
RewriteRule ^dir/category_(.*)$ /category.php?cat=$1 [L]

thriller aus

4:37 pm on Mar 2, 2006 (gmt 0)

10+ Year Member



let me check it.. but i will like to have the string in this fashion only category?cat=religion.

And retreive the value in php like

$variablename=$_Get['cat'];

thriller aus

5:43 pm on Mar 2, 2006 (gmt 0)

10+ Year Member



it will create a problem if i have dynamic query string from the database. So best which i prefer is to go with this style category.php?cat=stringvalue.

I need HELP!