Complex .htaccess rewrite Complex .htaccess rewrite apache apache

Complex .htaccess rewrite


Have your htaccess Rules file in following way. I have specifically covered 3 URLs shown by you in your question. Please make sure you use these Rules and make sure you clear your browser cache before testing your URLs.

<IfModule mod_rewrite.c>RewriteEngine OnRewriteRule ^(core/libraries/|includes|core/includes|core/vb|core/vb5|core/admincp|core/modcp) index.php?routestring=relay/404 [END]RewriteRule ^css\.php$ core/css.php [NC,L]####I have commented below rule that doesn't make sense, since NO right part in it only condition is mentioned.####RewriteRule ^install/core/install/ [NC,L]###New rules added by me to handle 3 different URLs shown by OP in question.RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(forum/news/state-news(?:(?:/city-news(?:area-news))))/(archive)/?$ $1?$2=yes [NC,QSA,L]RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)/?$ index.php?routestring=$1 [L,QSA]</IfModule>