php - Adding two different rules to htaccess file -


i have rule in .htaccess file force www url. here rule

#force www: rewriteengine on rewritecond %{http_host} ^example.com$ [nc] rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc] 

and trying add rule remove index.php in url. here other rule

#to remove /index.php rewritecond $1 !^(index\.php|resources|robots\.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l,qsa] 

i tried different ways, changing order of rules, removing [l] option, have first rule working not second, not sure missing. , guidance appreciated. thank you.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -