vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How do I Deny Access for Certain Directory? (https://vborg.vbsupport.ru/showthread.php?t=249057)

Mostjolly 08-21-2010 12:04 PM

How do I Deny Access for Certain Directory?
 
For example I wanted to deny all access to my /downloads area.

So say when a person enter: www.samplesite/downloads they be redirect back to the mainpage or hidden so they wouldn't even know it's existed.

Please do not advise to put on a password access page as I want to keep this directory hidden/non-existed from all members and guests.

I pretty sure this can be done.. maybe a little tweak in httaccess.. anyways please provided the codes or easy direction on to accomplish this.

Thanks all.

BirdOPrey5 08-21-2010 08:00 PM

You could set up a redirect in htaccess but no one would be able to access the directory including you... if that is the case it's better you don't even have the directory to begin with or if it's for backup files or such just move it 1 level above your public_html directory so it isn't accessibly by http at all.

Mostjolly 08-21-2010 11:01 PM

Thanks BOP5,

I'm interest in the htaccess redirection, please provided the codes to be used :)

BirdOPrey5 08-22-2010 12:00 AM

I believe your .htaccess file should look like this:

Code:

RewriteEngine on

Redirect 301 /downloads/ http://www.example.com/somewhere_else/

Where 'downloads' is the directory you want to 'hide' and 'somewhere_else' is any other directory on your site.

Mostjolly 08-22-2010 11:15 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2087578)
I believe your .htaccess file should look like this:

Code:

RewriteEngine on

Redirect 301 /downloads/ http://www.example.com/
somewhere_else/

Where 'downloads' is the directory you want to 'hide' and 'somewhere_else' is any other directory on your site.

It actually works.. I love you :)

An extra question.. I'd also like to know how to redirect for certain .php page, for example when someone type: www.yoursites.com/arcade.php ~~> I'd like it to redirect back to the hompage.

BirdOPrey5 08-22-2010 12:30 PM

Assuming you already have the line "RewriteEngine on" from the above, add this line:

Code:

redirect 301 /arcade.php http://www.example.com/index.php

Mostjolly 08-22-2010 02:19 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2087794)
Assuming you already have the line "RewriteEngine on" from the above, add this line:

Code:

redirect 301 /arcade.php http://www.example.com/index.php

Works like miracle.. I can't thank you enough!


All times are GMT. The time now is 09:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00991 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete