--- /dev/null
+# http://privoxy.org/.htaccess
+#
+# By Jon Foster
+#
+# Intercepts requests for these servers:
+# http://ijbswa.sourceforge.net/
+# http://privoxy.com/
+# http://www.privoxy.com/
+# http://www.privoxy.org/
+#
+# And redirects all requests to the canonical web server:
+# http://privoxy.org/
+#
+#
+# Uses Apache's mod_rewrite
+# See http://httpd.apache.org/docs/mod/mod_rewrite.html
+#
+
+# Enable mod_rewrite
+RewriteEngine on
+
+
+RewriteCond %{HTTP_HOST} !^privoxy\.org\.?$ [NC]
+RewriteCond %{HTTP_HOST} !^$
+RewriteRule ^(.*)$ http://privoxy.org/$1 [R,L]
+
# 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
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]