473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

htaccess redirect

134 100+
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
Dec 20 '08 #1
3 2284
vjayis
134 100+
helloo., anyone there to help me.....
Dec 22 '08 #2
Niheel
2,460 Expert Mod 2GB
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.
Dec 23 '08 #3
vjayis
134 100+
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???
Dec 23 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Nel | last post by:
Just looking for some general advice on modifying the URL for php. I am using .htaccess to allow a web site to translate example.html to index.php?content=example (below) ErrorDocument 404...
1
by: deko | last post by:
Can I use PHP and htaccess to authenticate users? My service provider lets me password protect directories on my web site - using htaccess. If a user tries to access a page within a password...
9
by: deko | last post by:
I want to use htaccess for authentication on my php site since I only have a few users who need access to secure areas. So, I created a new directory off public_html (secretDocs) and in that...
15
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects...
3
by: Vardan Kushnir | last post by:
Please forgive me if my English is poor. Also please tell me if this is wrong place to ask this question and tell me better place. When searching web for information Re: .htaccess and...
5
by: tommytx | last post by:
Is there any capability of decisions in htaccess. I know you can use in special situations, but I need something like: If a then b etc like in php. In other words I want to redirect the...
5
by: deko | last post by:
I'm trying to redirect requests for /index.php to /mydirectory/index.php If I use an index file in / with only this line: <?php header("Location:http://www.mysite.com/mydirectory/"); ?> that...
0
by: Stuart Palmer | last post by:
Hi everyone, I'm trying to look for an asp equivilent of .htaccess that is used on apache servers but for use with asp. I am doing a website and moving lots of files into a single directory to...
2
by: RuthC | last post by:
Hi. I am using .htaccess to redirect in my website Now I want to redirect a url, which Contain '-' to another url. ex: RewriteRule ^book-and-magazine-discount/ query.php?q=$1.
1
by: Lagon666 | last post by:
Hi I wanna have a htaccess file that when i go to "www.domain.com/sometext" the page redirect to "www.domain.com/user.php?user=sometext". It's important that is better that URL not end with slash....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.