Connecting Tech Pros Worldwide Help | Site Map

htaccess redirect

Member
 
Join Date: Mar 2008
Location: India
Posts: 100
#1: Dec 20 '08
hi

this is my htacess file
Expand|Select|Wrap|Line Numbers
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3.  
  4. RewriteRule videos/(.*)/$ all.php?i=$1
  5. RewriteRule gallery/(.*)/$ gallery/index.php?i=$1
  6.  
  7. RewriteCond %{REQUEST_FILENAME} !-f 
  8. RewriteCond %{REQUEST_URI} !^/Admin 
  9. RewriteCond %{REQUEST_URI} !^/news
  10. RewriteCond %{REQUEST_URI} !^/gallery
  11. RewriteCond %{REQUEST_URI} !^/xampp 
  12. RewriteRule ^ http://www.mysite.com/index.php
  13.  
it works fine and if i type http://www.mysite.com/includes/ it is redirected to my index.php as i hav written in the rule..

but if i type as http://www.mysite.com/Admin/images/ my directory is getting listed .,

its not fine right.,it should also be redirected to somewhere else.

so how can i stop this..

thanks
vijay
Member
 
Join Date: Mar 2008
Location: India
Posts: 100
#2: Dec 22 '08

re: htaccess redirect


helloo., anyone there to help me.....
KUB365's Avatar
Administrator
 
Join Date: Jul 2005
Location: Portland, OR
Posts: 965
#3: Dec 23 '08

re: htaccess redirect


It's because of the following line

RewriteCond %{REQUEST_URI} !^/Admin

If that URI exists, then it won't run the rewrite. You can setup another .htaccess file in your /Admin folder.
Member
 
Join Date: Mar 2008
Location: India
Posts: 100
#4: Dec 23 '08

re: htaccess redirect


Ok., so can i write the rewrite rules for the Admin folder as i hav written for the root folder or do i need to change anything out there???
Reply