]> git.deb.at Git - deb/packages.git/commitdiff
apache.conf: Use redirects for short URLs
authorFrank Lichtenheld <frank@lichtenheld.de>
Sun, 11 May 2008 23:37:59 +0000 (01:37 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Sun, 11 May 2008 23:37:59 +0000 (01:37 +0200)
The short search URLs previously used [PT], making it
appear as if these are canonical locations. They are not.
Always redirect to /search first.

conf/apache.conf.sed.in

index eba66647e2b9b35d243e56f9445e64df864bc0d4..274024874d63b42ea7d99f10ee957b4fb15473b3 100644 (file)
    RewriteRule ^/favicon.ico$ - [L]
 
 #   RewriteRule ^/$ http://www.debian.org/distrib/packages
-   RewriteRule ^/$ /index.html [L]
-   RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N]
-   RewriteRule ^/changelog:(.+)$  http://%SITE%/changelogs/${changelog-url:$1} [R,L,NE]
-   RewriteRule ^/src:([^/]+)$ /source/$1 [R,L,NE]
-   RewriteRule ^/file:(.+)$ http://%SITE%/search?searchon=contents&keywords=$1 [R,L,NE]
+   RewriteRule ^/$                     /index.html [L]
+   RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N]
+   RewriteRule ^/changelog:(.+)$       http://%SITE%/changelogs/${changelog-url:$1} [R,L,NE]
+   RewriteRule ^/src:([^/]+)$          http://%SITE%/search?searchon=sourcenames&keywords=$1 [R,L,NE]
+   RewriteRule ^/file:(.+)$            http://%SITE%/search?searchon=contents&keywords=$1 [R,L,NE]
+   RewriteCond %{REQUEST_URI} !^/search$ [OR]
+   RewriteCond %{QUERY_STRING} ^$
+   RewriteRule ^/([^/]+)$              http://%SITE%/search?keywords=$1 [R,L,NE]
 
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -f [OR]