apache - Htaccess redirect loop when using WWW in url -


i working on making site's urls pretty seo coming across problem when going 'obliquedev.x10.mx' site displays fine when going 'www.obliquedev.x10.mx' redirect loop error.

error : http://i.stack.imgur.com/xemj3.png

this .htaccess in root of site :

<ifmodule mod_rewrite.c>     rewriteengine on     rewriterule ^$ public/ [l]     rewriterule (.*) public/$1 [l] </ifmodule> 

and .htaccess in root/public :

<ifmodule mod_rewrite.c>     rewriteengine on     rewritecond %{request_filename} !-f     rewriterule ^(.+)$ index.php?url=$1 [l] </ifmodule> 

does know may causing issue?

you must use rewritecond exclude public being rewritten

rewritecond %{request_uri} !^/public rewriterule ^.*$ /public/$0 [l] 

you don't need 2 rules, 1 rule covers both cases.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

node.js - Bad Request - node js ajax post -

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -