apache - Removing .php extension won't work -
i using laravel, , .php removed using:
# handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l]
but using below force www , ssl , seems break above code , .php extension not removed anymore, doing wrong?
rewritecond %{https} !=on rewritecond %{http:x-forwarded-proto} !https #if neither above conditions met, redirect https rewriterule ^ https://%{http_host}%{request_uri} [l,r=301] #force www rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l]
full code
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes if not folder... rewritecond %{request_filename} !-d rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] rewritecond %{https} !=on rewritecond %{http:x-forwarded-proto} !https #if neither above conditions met, redirect https rewriterule ^ https://%{http_host}%{request_uri} [l,r=301] #force www rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l]
Comments
Post a Comment