Commit f62ae36c authored by ale's avatar ale

get rid of the top-level .htaccess

parent dd62e65f
RewriteEngine On
RewriteBase /
# Remove the old language prefix from the URLs.
RewriteRule ^[a-z][a-z]/(.*)$ /$1 [R=301,L]
# Remove the man_ prefix from the old howto URLs.
RewriteRule ^stuff/man_(.*)$ /docs/$1 [R=301,L]
# Rewrite URLs that only have a .html extension (no language),
# because we don't like them and they're ugly.
RewriteRule ^([^.]*)\.html$ /$1 [R=301,L]
......@@ -96,8 +96,6 @@ update_website() {
# ln -s "../static" "${site_dir}/static"
#fi
cp "${root_dir}/htaccess.txt" "${site_dir}/.htaccess"
# Index the site.
msg "updating search index"
if [ -e "${index_dir}" ]; then
......
......@@ -4,6 +4,8 @@ LoadModule access_compat_module /usr/lib/apache2/modules/mod_access_compat.so
LoadModule authn_core_module /usr/lib/apache2/modules/mod_authn_core.so
LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so
LoadModule mpm_worker_module /usr/lib/apache2/modules/mod_mpm_worker.so
Mutex pthread default
Mutex fcntl:${TESTROOT} mpm-accept
</IfVersion>
<IfVersion < 2.4>
......@@ -21,8 +23,6 @@ LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
#Listen 127.0.0.1:3300
Listen ${PORT}
ServerName test
PidFile ${TESTROOT}/test-httpd.pid
......@@ -65,3 +65,19 @@ ForceLanguagePriority Prefer Fallback
ProxyPass /search http://127.0.0.1:3301
ProxyPassReverse /search http://127.0.0.1:3301
# Rewrite rules to migrate old URLs.
RewriteEngine On
# Remove the old language prefix from the URLs.
RewriteRule ^/[a-z][a-z]/(.*)$ /$1 [R=301,L]
# Remove the man_ prefix from the old howto URLs.
RewriteRule ^/stuff/man_(.*)$ /docs/$1 [R=301,L]
# Rewrite URLs that only have a .html extension (no language),
# because we don't like them and they're ugly.
RewriteRule ^/([^.]*)\.html$ /$1 [R=301,L]
# Additional rule to handle ?hl=LANG
RewriteCond %{QUERY_STRING} \bhl=([a-z]*)
RewriteRule - [E=prefer-language:%1]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment