neonant
neonant

Reputation: 842

htaccess : stop subdirectory auto redirecting to root index

Well, I am sorry if this question already exist but I have failed to find it even after severe searching.

Suppose a part of my site directory is such -

/index.php (root)
/appdir/app1/index.php

But when I try to access app1/index.php it automatically redirects to root index.php. I couldn't find possible reason for this. My .htaccess looks like this :

IndexIgnore *
RewriteEngine on

#RewriteBase only requires in localhost alias 
RewriteBase /

Options +FollowSymlinks

RewriteRule ^(.*)_(v|V)[0-9\.]+\.(css|png|gif|jpe?g|html?|swf|js)$ $1.$3

AddDefaultCharset UTF-8 

Is there way to access my app index.php or stop redirecting to root directory? Thanks for your appreciation.

N.B: Full root htaccess file: http://pastebin.com/D1tvXh76

Upvotes: 1

Views: 2081

Answers (1)

Leri
Leri

Reputation: 12535

You need to add RewriteCond:

RewriteCond %{REQUEST_FILENAME} !-f #Does not rewrite file
RewriteCond %{REQUEST_FILENAME} !-d #Does not rewrite direcotry

For better understanding how mod_rewrite works read the manual

Upvotes: 1

Related Questions