Can anybody help me with subdomain -> uri value mod_rewrite? |
[eluser]BadZombi[/eluser]
Hey folks... Im having some issues getting mod_rewrite working the way I want with a CI project... I think it may be a conflict between my rule and the basic CI rules. Was hoping you fine people might be able to help me out. The idea is that http://anything.mysite.com (except www.mysite.com) will be rewritten to http://mysite.com/x/anything So... my current .htaccess file is functional but doesn't do quite what I want it to... I have it working as a redirect but would prefer it was transparent to users so they would always see http://anything.mysite.com Code: RewriteEngine On further examples for clarity: http://bob.mysite.com -> http://mysite.com/x/bob http://sam.mysite.com/stuff -> http://mysite.com/x/sam/stuff http://mary.mysite.com/#hash -> http://mysite.com/x/mary#hash wildcard dns already functions properly... only issue is changing from a redirect causes a 500 and/or an infinite loop. Any thoughts would be greatly appreciated. I've googled every variation on this theme I can think of but haven't found help that gets me where I want to be.
[eluser]BadZombi[/eluser]
Thanks for the link... theres actually some good info in there but it doesnt directly address my question. I've started to think that it may not be possible to do what I want... either due to a conflict in my other htaccess rules or maybe CI or server config. Gonna go a different route and have the default controller detect the subdomain and handle it right there.
[eluser]BadZombi[/eluser]
Just as a followup resolution post... didn't get my way with htaccess but this will work just fine Code: function index(){ |
Welcome Guest, Not a member yet? Register Sign In |