• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Advanced Controller Routing (based on domain)

#9
[eluser]stealthify[/eluser]
Ahh something is not quite right. I might have missed something small. I'm getting a 404 on everything except for the home page. (example: www.domain1.com/about)

I ended up going with the second htaccess in your post, Toopay, so it currently looks like this:

Code:
RewriteEngine on

RewriteCond $1 !^(index\.php|assets|robots\.txt|user_guide)
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.([^.:]+)
RewriteCond %{DOCUMENT_ROOT}application/modules/%1%2/ -d

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/%1%2/$1 [R=permanent,L]

I have a domain, say domain1.com, pointed to the directory with the 'application/' and index.php file in it. I have also, just for now, hardcoded the $config['base_url'] to be 'http://www.domain1.com/'. I will make this dynamic again after I figure this out.

My modules folder currently looks like this:

----------------------------------
public_html/application/modules/domain1.com/controllers/about.php
public_html/application/modules/domain1.com/views/about.php
----------------------------------

And I can successfully get the correct controller to load by manually going to:

http://www.domain1.com/index.php/domain1.com/about

but it will not work, I'll only get a error 404, if I go to:

http://www.domain1.com/domain1.com/about
or
http://www.domain1.com/about

Any ideas?

(also, I am running this on Apache)


Messages In This Thread
Advanced Controller Routing (based on domain) - by El Forum - 07-05-2011, 08:18 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-05-2011, 08:19 PM
Advanced Controller Routing (based on domain) - by El Forum - 07-05-2011, 10:39 PM
Advanced Controller Routing (based on domain) - by El Forum - 07-05-2011, 11:02 PM
Advanced Controller Routing (based on domain) - by El Forum - 07-07-2011, 08:58 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-07-2011, 09:23 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-07-2011, 09:35 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-07-2011, 09:41 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-08-2011, 12:42 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-08-2011, 06:07 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-08-2011, 06:18 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-08-2011, 06:43 AM
Advanced Controller Routing (based on domain) - by El Forum - 07-08-2011, 07:09 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.