EllisLab text mark
Advanced Search
     
Sub Domain redirection with .htaccess
Posted: 21 July 2007 11:06 AM   [ Ignore ]
Avatar
Joined: 2007-06-11
2985 posts

Ok so this isnt STRICTLY a CI question, but its a question people can use with CodeIgnitor…

If I have

http://john.doe.example.com

how can I make it go to

http://example.com/controller/method/john/doe/

Before you say “Duh use mod_rewrite”, dont. have been trying loads of rules for ages, so while mod_rewrite is the answer, its not particularly easy.

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management

 
Posted: 21 July 2007 01:48 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2006-07-10
485 posts

I’m not sure if this will help in your particular case:

http://ellislab.com/forums/viewthread/47523/

 
Posted: 22 July 2007 08:59 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-11
2985 posts

Closest I can get with links from that topic is:

RewriteEngine on
RewriteCond   %{HTTP_HOST}    ^www\.[^.]+\.kicknote\.com$
RewriteRule   ^(.+)    %{HTTP_HOST}$1   [C]
RewriteRule   ^www\.([^.]+)\.([^.]+)\.kicknote\.com index.php/mocknews/article/$1/$2

And it doesnt work…

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management