ilovekhym
ilovekhym

Reputation: 105

zend htaccess must allow access on /old dir

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]

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

Answers (1)

redmoon7777
redmoon7777

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

Related Questions