CodeIgniter Forums

Full Version: Rewrite a subdomain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Flak[/eluser]
I'm playing but can't make it work.

I have code igniter on subdirectory of a subdomain

ci.domain.com/ci/index.php/welcome


I want to rewrite to ci.domain.com/welcome

So when a user can go via ci.domain.com/welcome

any idea?

thanks

El Forum

[eluser]Flak[/eluser]
This is a piece of code that I am rolling:

____
Code:
<IfModule mod_rewrite.c>

# handle domain root and skip subfolders
RewriteCond %{HTTP_HOST} ci.domain.com
RewriteCond %{REQUEST_URI} !^/ci
RewriteCond %{REQUEST_URI} \..+$
RewriteRule ^(.*)$ ci/$1 [L]

# handle files in subfolders
RewriteCond %{HTTP_HOST} ci.domain.com
RewriteCond %{REQUEST_URI} !^/ci
RewriteRule ^(.*)$ ci/$1/ [L]
</IfModule>
____