| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Web Marketing Specialist Join Date: Oct 2003 Location: Texas, USA
Posts: 1,335
![]() ![]() ![]() | .htaccess authentication How would i go about makeing a directory avaliable only to the people how got to it from a certain url? For example: The only way a user could get to www.example.com/directory is if they came from www.example.com/login.php. login.php would be the verification script in php and all the .htaccess would do it prevent someone from just going to the folder by typing in the url Thanks! |
| |
| | #5 (permalink) |
| Professional Monkey Join Date: Jul 2005 Location: Escaped from the zoo
Posts: 907
![]() ![]() | in .htaccess use RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://www.example.com/login.php$ RewriteRule ^.*$ - [NC,L] if you wanted it to work exactly as you have described you would use RewriteEngine On RewriteCond %{THE_REQUEST} directory RewriteCond %{HTTP_REFERER} !^http://www.example.com/login.php$ RewriteRule ^.*$ - [NC,L]
__________________ Webmaster Words |
| |
| | #7 (permalink) |
| Senior Member Join Date: Dec 2004
Posts: 1,304
![]() ![]() ![]() ![]() ![]() | Why don't you just use .htaccess and .htpasswd to gain access to the folder
__________________ You got no time for the messenger, got no regard for the thing that you don't understand, you got no fear of the underdog, that's why you will not survive! |
| |
| | #9 (permalink) |
| Senior Member Join Date: Dec 2004
Posts: 1,304
![]() ![]() ![]() ![]() ![]() | Is this login to access pages, or to access files for download?
__________________ You got no time for the messenger, got no regard for the thing that you don't understand, you got no fear of the underdog, that's why you will not survive! |
| |
| | #10 (permalink) |
| Eating Pie Join Date: Nov 2004 Location: Canada
Posts: 2,272
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | A little bit of PHP to include the file as a attachment and AuthGroupFile /dev/null AuthName Downloads AuthType Basic <Limit GET POST PUT> deny from all </Limit> In .htaccess will work just fine. - Steve
__________________ I feel old. |
| |
| | #11 (permalink) | ||||
| Senior Member Join Date: Dec 2004
Posts: 1,304
![]() ![]() ![]() ![]() ![]() |
__________________ You got no time for the messenger, got no regard for the thing that you don't understand, you got no fear of the underdog, that's why you will not survive! | ||||
| |
| | #12 (permalink) | ||||
| NamePros Regular Join Date: Feb 2006 Location: Atlanta, GA, USA
Posts: 335
![]() ![]() |
PHP Code: PHP Code: PHP Code: | ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SEO with mod_rewrite and .htaccess | cDizzle | CODE | 1 | 01-08-2006 02:50 AM |
| $15 for a .htaccess file - Precise criteria required | mholt | Web Development Wanted | 1 | 11-06-2005 10:16 PM |
| Using mod_rewrite and a .htaccess to do some redirection... 25 NP$ REWARD | mholt | Programming | 0 | 09-21-2005 03:15 PM |
| .htaccess + Domain Parking | wistow | Programming | 15 | 07-04-2005 09:46 AM |
| .htaccess | D@Z | Web Design Discussion | 5 | 04-27-2005 09:27 PM |