Web Hosting Talk







View Full Version : .htaccess question


WoodShedd
06-08-2002, 11:20 PM
I have an htaccess issue: I wish to add the some htaccess code to folder "b", but folder "b" already contains a .htacces file.
the .htacces file currently in folder "b" contains:


php_value post_max_size 20971520
php_value upload_max_filesize 20971520
php_flag magic_quotes_gpc off
php_flag register_globals on


Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /members/gallery/
RewriteRule ^([^\.\?/]+)/([0-9]+)$ /members/gallery/view_photo.php?set_albu
mName=$1&index=$2 [QSA]
RewriteRule ^([^\.\?/]+)/([A-Za-z_0-9\-]+)$ /members/gallery/view_photo.php?
set_albumName=$1&id=$2 [QSA]
RewriteRule ^([^\.\?/]+)/$ /members/gallery/$1 [R]
RewriteRule ^([^\.\?/]+)$ /members/gallery/view_album.php?set_albumName=$1
[QSA]
</IfModule>


The code I wish to add is:

AuthUserFile /dev/null
AuthGroupFile /dev/null

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://xxx.xxx.xxx.xxx [NC]
RewriteCond %{HTTP_REFERER} !^http://xxx.xxx.xxx.xxx [NC]
RewriteCond %{HTTP_REFERER} !^http://www.site.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://site.com/ [NC]
RewriteRule /* http://xxx.xxx.xxx.xxx [R,L]


How would I go about combining the two so all runs smoothly?

thanks :)

priyadi
06-09-2002, 02:54 AM
Try this:


php_value post_max_size 20971520
php_value upload_max_filesize 20971520
php_flag magic_quotes_gpc off
php_flag register_globals on


Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /members/gallery/
RewriteCond %{HTTP_REFERER} !^http://xxx.xxx.xxx.xxx [NC]
RewriteCond %{HTTP_REFERER} !^http://xxx.xxx.xxx.xxx [NC]
RewriteCond %{HTTP_REFERER} !^http://www.site.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://site.com/ [NC]
RewriteRule /* http://xxx.xxx.xxx.xxx [R,L]
RewriteRule ^([^\.\?/]+)/([0-9]+)$ /members/gallery/view_photo.php?set_albu
mName=$1&index=$2 [QSA]
RewriteRule ^([^\.\?/]+)/([A-Za-z_0-9\-]+)$ /members/gallery/view_photo.php?
set_albumName=$1&id=$2 [QSA]
RewriteRule ^([^\.\?/]+)/$ /members/gallery/$1 [R]
RewriteRule ^([^\.\?/]+)$ /members/gallery/view_album.php?set_albumName=$1
[QSA]
</IfModule>

AuthUserFile /dev/null
AuthGroupFile /dev/null