.htaccess - htaccess - Exception when no file is specified -
i'm trying make .htaccess www.domain.com/?get=1234 gets rewritten www.domain.com/1234 , exceptions files such style.css, logo.png, etc.
this works great files can't figure out how make exception www.domain.com/ directory index.php file, , putting index.php exception forces user include index.php in url ofcourse don't like.
thanks in advance. .htaccess far:
rewriteengine on # exceptions rewritecond %{request_uri} !/favicon.ico rewritecond %{request_uri} !/index.php rewritecond %{request_uri} !/style.css rewritecond %{request_uri} !/logo.png # rewriting rewriterule ^([^/]*)$ /?get=$1 [l] # www rewriting rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l]
if want rewrite everything, excluding real files , directories, can use these 2 rewriteconds exception guards
rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d
Comments
Post a Comment