Organizational Research By

Surprising Reserch Topic

how to write Apache Multiple Rewrite Rules?



asked Sep 22, 2013 in APACHE by rajesh
0 votes
43 views



Related Hot Questions

1 Answer

0 votes
i will still be needed as Last flag is for marking end of each rewrite rule. Ordering of rules is also important. Change your code to this:
 
    ServerName datingjapan.co
    ServerAlias *.datingjapan.co
    DocumentRoot /var/www/html/datingjapan.co
 
    RewriteEngine on
 
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*) http://www.%{HTTP_HOST}$1 [R=301,L]
 
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^(.*)$ /index.php?/$1 [L,QSA]
 
answered Sep 22, 2013 by rajesh

...