Stardoll Cheats Forum - Wordpress Themes - Jobs search - Online Advertising - Wordpress Themes

PDA

View Full Version : php and .htaccess rewrite.


killaklown
Dec 17th 2007, 4:10 pm
How can I do


if($_GET['category'] == $cat) {

//stuff

}


with .htaccess rewrite on?

The rewrite is:
RewriteRule ^category/([^/]+)?$ index.php?category=$cat [QSA,L]



I cant seem to get it to work. (never did rewrite before)

hogan_h
Dec 17th 2007, 4:57 pm
Did you try this:

RewriteEngine On
RewriteRule ^category/([^/]+)?$ index.php?category=$1


You can call url then with http://www.yourwebsite.com/category/5

if(isset($_GET['category'])) {

echo "Category is: ".$_GET['category'];

}

killaklown
Dec 18th 2007, 5:10 pm
thanks. +rep!