.htaccess - htaccess mod_rewrite issue. trailing / -
i using mod_rewrite remove .php in links. getting weird behavior when adding trailing / rewritten link; external resources don't load. wondering if can mitigate this. thank you.
rewriteengine on rewritecond %{http_host} !^www.allprepaidplans.com$ [nc] rewriterule ^(.*)$ http://www.allprepaidplans.com/$1 [l,r=301] rewritecond %{the_request} ^get\s(.*/)index\.php [nc] rewriterule . %1 [ne,r=301,l] rewritecond %{the_request} ^get\s.+\.php [nc] rewriterule ^(.+)\.php$ /$1 [ne,r=301,l,nc] rewritecond %{request_filename} !-d rewritecond %{document_root}/$1.php -f rewriterule ^(.*?)/?$ $1.php [l]
if "external resources" mean images, styles, scripts, etc. need make links absolute or add relative uri base:
<base href="/">
Comments
Post a Comment