Using canonical hostname
authorjongfoster <jongfoster@users.sourceforge.net>
Mon, 25 Mar 2002 23:13:33 +0000 (23:13 +0000)
committerjongfoster <jongfoster@users.sourceforge.net>
Mon, 25 Mar 2002 23:13:33 +0000 (23:13 +0000)
doc/webserver/.htaccess [new file with mode: 0644]
doc/webserver/config/.htaccess

diff --git a/doc/webserver/.htaccess b/doc/webserver/.htaccess
new file mode 100644 (file)
index 0000000..0ecf688
--- /dev/null
@@ -0,0 +1,26 @@
+# 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]
+
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]