Welcome Guest, Not a member yet? Register   Sign In
.htaccess mod_rewrite with two CI apps
#1

[eluser]Unknown[/eluser]
[edit] nevermind got it working w/ the below code.. I was originally trying to get index.php rewrites working for both the root level app as well as a copy placed in a subfolder.. however now I just realize it's easier to just have the rewrite only work on root domain.. sorry nevermind!

mod feel free to delete this post![/edit]

Hello,

I have a 'live' version of my site, and would like to have a 'test' version which is stored on a subfolder from the root on my web host. (ie mysite.com/test)

I have an .htaccess file in place which seems to work well for removing the index.php on the 'live' (and root) website.. all good there.

Now I'd like to set it up to NOT do a re-write for the 'test' subfolder. (At first I wanted the rewrite but I can't get it working, and it seems this could be easier to setup?)

This is my current attempt. Unfortunately I get a 404 once I try to access the subfolder version:

Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]

RewriteCond $1 !^(index\.php|.*\.js|.*\.css|images|robots\.txt|test)
RewriteRule ^(.*)$ /index.php/$1 [L]

In other words I've added 'test' to the negative RewriteCond expression to try to have this rule ignore the test subfolder.. but no dice.

Any suggestions?




Theme © iAndrew 2016 - Forum software by © MyBB