Reputation: 105
I already check all similar titles for this but still havent found one.
I want to use Zend for our new project and what i want to do is to allow access on /old directory which contain our old app.
I try to use this htaccess rules:
#old
RewriteCond %{REQUEST_URI} !^/old/
RewriteRule ^(.*)/$ $1 [L,R=301]
#zend
RewriteCond %{REQUEST_URI} (.*)/$
RewriteRule ^(.*)/$ $1 [L,R=301]
if visiting root folder, zend handle it properly
if /old, the error is: the server is redirecting the request for this address in a way that will never complete.
What i want is if the user visits the root directory, the zend will handle it.
If they visit the /old, then it will be skipped by zend and will use the index.php of that dir.
thanks in advance
My application structure is
/application
/library
.htaccess
index.php - (zend index.php handler)
/old
/old/index.php (old app)
my .htaccess content
RewriteEngine on
RewriteBase /gabriel/newapp
#old redirect
# if old/ redirect to /old
RewriteCond %{REQUEST_URI} ^/old/
RewriteRule ^(.*)/$ $1 [L,R=301]
#else zend
RewriteCond %{REQUEST_URI} (.*)/$
RewriteRule ^(.*)/$ $1 [L,R=301]
Upvotes: 0
Views: 204
Reputation: 4526
try :
RewriteEngine on
#old redirect
# if old/ redirect to /old
RewriteRule ^old($|/) - [L]
RewriteBase /gabriel/newapp
#else zend
RewriteCond %{REQUEST_URI} (.*)/$
RewriteRule ^(.*)/$ $1 [L,R=301]
Upvotes: 1