Forum Moderators: phranque

Message Too Old, No Replies

RewriteCond used properly?

         

kokos

8:41 am on Mar 3, 2005 (gmt 0)



Hello,
I'd like your opinion if this part .htaccess is properly written or if you would do it another more efficient way.

Thanks,
David.

--------------
php_value session.use_cookies 0

RewriteEngine on
RewriteCond %{query_string} ^id_contr=([0-9]*)(&PHPSESSID=(([0-9]*[a-z]*)*))?$
RewriteRule buildCat\.php /index.php?m_id=buildCat&%{QUERY_STRING}

RewriteCond %{query_string} ^id_cat=([0-9]*)(&PHPSESSID=(([0-9]*[a-z]*)*))?$
RewriteRule buildIndex\.php /index.php?m_id=buildIndex&%{QUERY_STRING}

RewriteCond %{query_string} ^view_order=([0-9]*)&id_cat=([0-9]*)(&PHPSESSID=(([0-9]*[a-z]*)*))?$
RewriteRule view\.php /index.php?m_id=view&%{QUERY_STRING}

RewriteCond %{query_string} ^id=([0-9]*)(&PHPSESSID=(([0-9]*[a-z]*)*))?$
RewriteRule view\.php /index.php?m_id=view&%{QUERY_STRING}

Caterham

6:54 pm on Mar 3, 2005 (gmt 0)

10+ Year Member



So far I can see, you might be able to use

RewriteEngine On
RewriteRule ^(buildCat¦buildIndex¦view)\.php$ /index.php?m_id=$1 [QSA,L]

The QSA-Flag will append the exsisting queryString.

You'll have to replace the pipes ¦ with propper ones from your keyboard.

Robert