CodeIgniter Forums
Help with CI app-path, subdomains and .htaccess - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Help with CI app-path, subdomains and .htaccess (/showthread.php?tid=16398)



Help with CI app-path, subdomains and .htaccess - El Forum - 03-05-2009

[eluser]moodh[/eluser]
TL;DR: *.url.com => url.com/dev/$1 while using/not destroying the subsequent rewriterules ;p

Hi, I'm using the following .htaccess at the moment:

Code:
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    Options -Indexes
    DirectoryIndex index.php
    RewriteEngine on
    RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

And I'm trying to add a dynamic subdomain:
I want everything that comes from *.url.com to end up at url.com/index.php?dev/$1 (/dev/$1 pretty much) but I can't get it to work, mainly due to poor mod_rewrite experience. So I thought I'd ask here.
The above htaccess is the one without any changes, as they didn't get very far =P

The endgame is to alter the $application_folder variable depending on what the wildcards value is. At the moment I'm snapping up dev/wildcard and split it there, any other suggestions? Help would be appricated!


Help with CI app-path, subdomains and .htaccess - El Forum - 03-05-2009

[eluser]TheFuzzy0ne[/eluser]
I don't see the problem, as long as the subdomain is set up, and the DNS is set to aim requests at your Web root, it shouldn't matter what subdomain is used.


Help with CI app-path, subdomains and .htaccess - El Forum - 03-05-2009

[eluser]moodh[/eluser]
Ya, ignore my thread, has some rough fights with the webhost just now and managed to solve everything without touching the htaccess =)
Close/lock or whatever ;p thanks!