.htaccess - url rewriting add prefix www with htaccess -
i created website symfony , want rewrite url. url apprears this: domain.com/web/
i removed web/ adding code .htaccess file:
<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewriterule ^(.*)$ web/$1 [qsa,l] </ifmodule>
this worked perfectly.
my target add www. prefix. solved adding code:
rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l]
the result ok. in fact,
- the url domain.com becomes www.domain.com (perfect!!!)
- the url domain.com/something/ becomes www.domain.com/something/ (perfect!!!)
- the url domain.com/web/ stays same (it's url not change)
is there idea redirect domain.com/web/ www.domain.com???
thanks...
this behavior caused condition existing files won't rewritten:
rewritecond %{request_filename} !-f
Comments
Post a Comment