![]() |
how would you do this (preferably using .htaccess)
How would you set a directory so that a call to
somedomain.com/somedirectory/index.html would load the index.html but a call to somedomain.com/somedirectory/ could be redirected because they didn't include the index.html Can this be done? |
are you wanting to stop showing a directory listing?
in .htaccess you just place Options -Indexes if that's the case, if not look @ mod_rew\rite, I'm not sure I understand the question, so can't tell much more than that. |
Quote:
Problem is that if you don't request a file name in the URL it looks for an index file , if it finds one it doesn't generate a 303 or 404 error. Just wondering if there's a way round it. |
RehahahahahaEngine on
RehahahahahaRule ^/$ /some/where/else [R] ? *edit* hahahahaha = w r i t e without the spacing .. :) |
Quote:
|
Add
DirectoryIndex notfound.html or something ... |
if it doesnt work read : http://httpd.apache.org/docs/misc/re...hahaguide.html :)
*edit* nice banned words Lens |
Quote:
maybe there's a way to use .htaccess to tell the server NOT to look for an index page and therefore generate a 404 error when an open directory is called? |
in your httpd.conf you set
DirectoryIndex index.html index.htm index.php index.cgi index.pl default.htm default.html apache loads whichever finds first in the order you have so you need to remove index.html from DirectoryIndex, this directive also works from htaccess file, after you remove index.html, set ErrorDocumen</b>t 404 /404.html or index in your htaccess |
All times are GMT -7. The time now is 12:46 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123