Using canonical hostname
[privoxy.git] / doc / webserver / config / .htaccess
index 934ac19..0a2bfbf 100644 (file)
@@ -3,7 +3,9 @@
 # By Jon Foster
 #
 # Redirects any request for any file in this directory tree
-# to an error page.
+# to an error page.  The error page is reached through the
+# URL http://privoxy.org/config/ and is actually in
+# the file index.php
 #
 # Uses Apache's mod_rewrite
 # See http://httpd.apache.org/docs/mod/mod_rewrite.html
@@ -16,13 +18,17 @@ RewriteEngine on
 RewriteBase   /config/
 
 # The only file which really exists is index.php - allow this
+RewriteCond %{HTTP_HOST}   ^privoxy\.org\.?$ [NC,OR]
+RewriteCond %{HTTP_HOST}   ^$
 RewriteRule  index.php - [L]
 
 # Silently redirect the config dir to index.php
+RewriteCond %{HTTP_HOST}   ^privoxy\.org\.?$ [NC,OR]
+RewriteCond %{HTTP_HOST}   ^$
 RewriteRule  ^$      index.php [L]
 
 # anything else gets redirected to the config dir, and we update
 # the browser's location bar.
-RewriteRule  ^(.*)$  /config/  [R]
+RewriteRule  ^(.*)$  http://privoxy.org/config/  [R,L]