-
.htaccess with 2 rules?
Not sure this is the right forum, but I'. trying to figure out how to make 2 mod_rewrite rules within the same htaccess file. I have 2 main pages, index.php and users.php. users.php is if a user is logged in. Now what I want is a address like this: mydomain.com/users.php?ga=news&cn=238479&user=342 should look like this: mydomain.com/news but I havent have luck with this...
This is what I have done:
Code:
AddDefaultCharset UTF-8
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ users.php?ga=$1 [QSA]
Thanks...
-
mod_rewrite allows you to map requested URIs to internal URIs using regular expressions
that is all
it can't create the "cn=238479&user=342" part since that data doesn't appear in the requested URI ("/news")
this logic probably belongs in your PHP code, not a URL rewriting rule