Domain routing possibilities in CI? |
[eluser]Sean Murphy[/eluser]
Why do you still need that block of code? Are you pointing more than one domain at the same code base?
[eluser]stevefink[/eluser]
Hi sean, Not entirely sure what you mean why do I still need that block of code. That block above is the one that's routing the URL I'm looking to map properly. Thanks again, /sf
[eluser]lonka[/eluser]
Hi, I try the same way to do something similar but I got error 500. Is it possible to make with mod_rewrite that subdomain for example %username%.domainname.com will be pointing to domainname.com/users/%username% ?
[eluser]Sean Murphy[/eluser]
Code: RewriteCond %{HTTP_HOST} ^([^\.]+)\. That should make seanmurphy.example.com/dashboard go to example.com/index.php/users/seanmurphy/dashboard. If you plan to use other subdomains or www you'll need to make some adjustments.
[eluser]lonka[/eluser]
I only want that www.example.com and example.com go to => www.example.com and someone.example.com/dashboard should read from example.com/users/someone/dashboard
[eluser]Sean Murphy[/eluser]
Hopefully this will work for you... Code: RewriteCond %{HTTP_HOST} ^((?!www\.)[^\.]+)\.
[eluser]lonka[/eluser]
And should I add this or replace or mix with one that I already have in .htaccess? My file: Code: RewriteEngine on
[eluser]Sean Murphy[/eluser]
You can try this and see how it works. Keep in mind that I haven't tested it myself. Code: RewriteEngine on Code: RewriteCond $1 !^([a-zA-z0-9/])
[eluser]lonka[/eluser]
[quote author="Sean Murphy" date="1210031824"]You can try this and see how it works. Keep in mind that I haven't tested it myself.[/quote] Thank you, I will test this and see what happens [quote author="Sean Murphy" date="1210031824"] BTW, why do you need... Code: RewriteCond $1 !^([a-zA-z0-9/]) I don't know mod_rewrite, but I suppose that this is to allow only letters and numbers? I get this from google, so it could be wrong.
[eluser]lonka[/eluser]
Unfortunately I have got 500 Internal Error again When I delete line with Code: RewriteCond %{HTTP_HOST} ^((?!www\.)[^\.]+)\. I try to change rule to Code: RewriteCond %{HTTP_HOST} ^((?!www\.)[^\.]+)\.$ |
Welcome Guest, Not a member yet? Register Sign In |