Forum Moderators: phranque
my .htaccess file is like that
RewriteRule index.php[b]_[/b]articleid_([0-9]+)_docid=([0-9]+) index.php?articleid=$1&docid=$2 and my link
http://www.example.com/index.php[b]_[/b]articleid_21_docid=87 it works good but it must be like that
http://www.example.com/index.php[b]?[/b]articleid_21_docid=87 when i add ? question mark to .htaccess and then link doesn't work
RewriteRule index.php[b]?[/b]articleid_([0-9]+)_docid=([0-9]+) index.php?articleid=$1&docid=$2 how can i do my link like that with .htaccess
http://www.example.com/index.php[b]?[/b]articleid_21_docid=87 [edited by: encyclo at 2:27 am (utc) on Nov. 3, 2009]
[edit reason] fixed formatting error [/edit]
RewriteCond %{QUERY_STRING} ^articleid_([0-9]+)_docid=([0-9]+)$
RewriteRule ^index.php$ /index.php?articleid=%1&docid=%2
RewriteCond %{QUERY_STRING} ^articleid_([0-9]+)_docid=([0-9]+)$
RewriteRule ^index.php$ /index.php?articleid=%1&docid=%2 [L]
You should always use the Last flag [L] unless you know you don't need it. (It stops any following rules from being processed for the request matching the rule, and things can get unexpectedly ugly if it's not used, unless of course you know why you didn't use it...)