htaccess redirect

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vjayis
    New Member
    • Mar 2008
    • 134

    htaccess redirect

    hi

    this is my htacess file
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteRule videos/(.*)/$ all.php?i=$1
    RewriteRule gallery/(.*)/$ gallery/index.php?i=$1
    
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_URI} !^/Admin 
    RewriteCond %{REQUEST_URI} !^/news
    RewriteCond %{REQUEST_URI} !^/gallery
    RewriteCond %{REQUEST_URI} !^/xampp 
    RewriteRule ^ http://www.mysite.com/index.php
    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
  • vjayis
    New Member
    • Mar 2008
    • 134

    #2
    helloo., anyone there to help me.....

    Comment

    • Niheel
      Recognized Expert Moderator Top Contributor
      • Jul 2005
      • 2432

      #3
      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.
      niheel @ bytes

      Comment

      • vjayis
        New Member
        • Mar 2008
        • 134

        #4
        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???

        Comment

        Working...