Welcome Guest, Not a member yet? Register   Sign In
Mod_Rewrite Voodoo Problem - not just your average magic... [solved - but interesting!]
#3

[eluser]Volder[/eluser]
Code:
RewriteCond %{HTTP_HOST} !^(www\.foo.*)$ [NC]                    
RewriteCond %{HTTP_HOST} ^([a-z\-\_]*)\.foo\.([a-z\.]{2,5})$ [NC]            

RewriteRule ^(.*)$ index.php/site/%1

it looks like the rule 2 as it is, has an infinite loop by itslef - so strange that it is working fine by itself (maybe apache or whatever server you use automatically detects a loop and stops it).

So if you give as an input right now:
http://bar.foo.ie/this/topic
1 iteration: http://bar.foo.ie/site/bar
2 iteration: http://bar.foo.ie/site/bar/site/bar

so 2 mistakes I see: you don't specify fully the domain and subdomain here + you loose everything in your parameters.

So try the following fix:
Code:
RewriteCond %{HTTP_HOST} !^(www\.foo.*)$ [NC]                    
RewriteCond %{HTTP_HOST} ^([a-z\-\_]*)\.foo\.([a-z\.]{2,5})$ [NC]            

RewriteRule ^(.*)$ http://www.foo.%3/index.php/site/%2/$1

I use %2, %3 because %1 should relate to first RewriteCond (which we don't want), right? I don't remember for sure.

I have not tried it (just thoughts), so probably it is not a working soluition, but could be of some help for you.


Messages In This Thread
Mod_Rewrite Voodoo Problem - not just your average magic... [solved - but interesting!] - by El Forum - 04-13-2010, 07:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB