0

when i wrote localhost/site/images/

i can see all images of my site...
how can i stop it...!!

i tried .htaccess with code "deny to all"

but it does not show images when i run the site on browser..!!

What should i do.?

3
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by sam023
0

when i wrote localhost/site/images/

i can see all images of my site...
how can i stop it...!!

i tried .htaccess with code "deny to all"

but it does not show images when i run the site on browser..!!

What should i do.?

In the .htaccess file put:

Options -Indexes
0

you should create an index.html file with following code in /images directory

<script language="javascript">
window.location='http://localhost/site';
</script>

What if the user had disabled JS ?

Better with this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|gif|png|bmp)$
RewriteRule (.*) http://siteurl [L,R=301]
0

you should create an index.html file with following code in /images directory

<script language="javascript">
window.location='http://localhost/site';
</script>

Good Idea..!!

or instead of javascript.. should i use header('location:index.php');
as user can off javascript..!!

0

What if the user had disabled JS ?

Better with this:

RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|gif|png|bmp)$
RewriteRule (.*) http://siteurl [L,R=301]

Actually i cant use.. .htaccess because it's not working in my linux server.!! even i check mod_rewrite module in httpd.conf

still its not working..!!

0

Actually i cant use.. .htaccess because it's not working in my linux server.!! even i check mod_rewrite module in httpd.conf

still its not working..!!

Apache by default doesn't allow customization of options. Two things you need to check for .htaccess to work:

1. The <Directory> directive for the top-level directory in which docroot resides has the following:

AllowOverride All

2. AccessFileName directive has the value .htaccess

0

Apache by default doesn't allow customization of options. Two things you need to check for .htaccess to work:

1. The <Directory> directive for the top-level directory in which docroot resides has the following:

AllowOverride All

2. AccessFileName directive has the value .htaccess

Now it's working.. thanks to u n all..!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.