Welcome Guest, Not a member yet? Register   Sign In
mod_rewrite codeigniter index.php redirect looping problem with virtual directory
#1

[eluser]Unknown[/eluser]
Hello, i've been looking through the forms here and on stackoverflow looking for a solution to my problem but have not been able to find it. If anyone can help me out with this, i'd greatly appreciate it.

To get past the CI Forums spam filter (since this is my first post) I had to put spaces between the urls.

I have one CI codebase that I want to be able to use for multiple client sites based on whatever url the client wants to use.

it supports domains and any subdomain variation without any issues, however i also want it to support a domain ending with a folder. For example: http ://app.client1 .com/site1/ . I want /site1/ to stay in the url, but not cause my CI instance to think it is an actual folder.

So basically I want the following types of sites to work with my single CI instance.
[doesn't work] http ://app.client1 .com/site1/
[doesn't work] http ://app.client1 .com/site2/
[works] http ://client2 .com
[works] http ://site1.client3 .com
[works] http ://site2.client3 .com

Here is what my apache domain config file basically looks like
# app.client1 .com/*
<VirtualHost *:80>
# General
ServerAdmin [email protected]
DocumentRoot /www/CI
ServerName app.client1 .com

# Redirect all www traffic to non-www
RewriteEngine On

RewriteRule ^/([-A-z0-9]+).*$ / [QSA,L]
</VirtualHost>

My CI instance is using the .htaccess code to get rid of the index.php as listed on the codeigniter website (codeigniter .com/wiki/mod_rewrite)

What currently happens for sites with the trailing folder is a redirect loop error where the mod_rewrite does something crazy by adding a bunch of index.php's..
e.g. http ://app.client1 .co/site1/index.php/message/index/index.php/index.php/index.php/index.php/index.php/index.php/

Any help would be greatly appreciated on this.

Thanks!
Graham M.




Theme © iAndrew 2016 - Forum software by © MyBB