[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#671171: apache2.2: mod_speling offers only permanent redirects



Package: apache2.2-bin
Version: 2.2.16-6+squeeze4zynet1
Severity: wishlist
File: apache2.2


mod_speling offers only permanent redirects, whilst this saves on CPU it
means that you are potentially storing issues for renaming content of a
web site in future as browsers will cache this indefinitely.

I propose a patch that adds "SpellingRedirectTemporary" 

So that adding "SpellingRedirectTemporary On" to the configuation causes
Apache to issue 302 redirects instead of 301, which are pre-expired
causing clients to always retry.


-- System Information:
Debian Release: 6.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-25-hvmflexiant (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apache2.2-bin depends on:
ii  libapr1                1.4.2-6+squeeze3  The Apache Portable Runtime Librar
ii  libaprutil1            1.3.9+dfsg-5      The Apache Portable Runtime Utilit
ii  libaprutil1-dbd-sqlite 1.3.9+dfsg-5      The Apache Portable Runtime Utilit
ii  libaprutil1-ldap       1.3.9+dfsg-5      The Apache Portable Runtime Utilit
ii  libc6                  2.11.3-2          Embedded GNU C Library: Shared lib
ii  libcap2                1:2.19-3          support for getting/setting POSIX.
ii  libldap-2.4-2          2.4.23-7.2        OpenLDAP libraries
ii  libpcre3               8.02-1.1          Perl 5 Compatible Regular Expressi
ii  libssl0.9.8            0.9.8o-4squeeze12 SSL shared libraries
ii  zlib1g                 1:1.2.3.4.dfsg-3  compression library - runtime

apache2.2-bin recommends no packages.

apache2.2-bin suggests no packages.

-- no debconf information
--- orig/httpd-2.2.16/modules/mappers/mod_speling.c	2008-04-17 15:10:52.000000000 +0100
+++ apache2-2.2.16/modules/mappers/mod_speling.c	2012-05-02 09:50:15.000000000 +0100
@@ -60,6 +60,7 @@
 typedef struct {
     int enabled;
     int case_only;
+    int redirect_temporary;
 } spconfig;
 
 /*
@@ -77,6 +78,7 @@
 
     cfg->enabled = 0;
     cfg->case_only = 0;
+    cfg->redirect_temporary = 0;
     return cfg;
 }
 
@@ -109,6 +111,9 @@
     AP_INIT_FLAG("CheckCaseOnly", ap_set_flag_slot,
                   (void*)APR_OFFSETOF(spconfig, case_only), OR_OPTIONS, 
                  "whether or not to fix only miscapitalized requests"),
+    AP_INIT_FLAG("SpellingRedirectTemporary", ap_set_flag_slot,
+                  (void*)APR_OFFSETOF(spconfig, redirect_temporary), OR_OPTIONS, 
+								 "whether to issue a 301 or a 302 on spelling errors"),
     { NULL }
 };
 
@@ -399,6 +404,8 @@
                               : "Fixed spelling: %s to %s",
                           r->uri, nuri, ref);
 
+						if (cfg->redirect_temporary == 1) return HTTP_MOVED_TEMPORARILY;
+
             return HTTP_MOVED_PERMANENTLY;
         }
         /*

Reply to: