2008-10-17 Apache Rewrite Adds Slashes

Hm... I have an Apache Rewrite problem. Does anybody understand the following? What I wanted to was this:

If somebody visits /wiki/Foo the request is rewritten to /cgi-bin/alex/Foo. This works.

If somebody visits /wiki?action=foo the request is rewritten to /cgi-bin/alex/?action=foo. Notice the extra slash.

Why is that? Somebody is sending a 301 Moved Permanently response. But who?

I’m starting at the RewriteRule documentation and searching for the word “redirect” trying to make sense of it all. The only passage that seems to be relevant:

=> RewriteRule

If an absolute URL is specified, mod_rewrite checks to see whether the hostname matches the current host. If it does, the scheme and hostname are stripped out and the resulting path is treated as a URL-path. Otherwise, an external redirect is performed for the given URL.

Grrrr! I must have introduced something when I fiddled with .htaccess, recently.

And I’ve been getting these for years now. If only I knew what caused them:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.

​#Oddmuse ​#Wikis ​#Web

Comments

(Please contact me if you want to remove your comment.)

I need to look into this. There is no such problem on the CommunityWiki site, for example. But even after investing quite some time and rewriting my .htaccess file multiple times, I’m no closer to a solution than before.

– Alex Schroeder 2008-10-18 09:11 UTC

=> Alex Schroeder


Taking a look at this, I have to ask what does the following?

Proxy Information
Original URL
gemini://alexschroeder.ch/2008-10-17_Apache_Rewrite_Adds_Slashes
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
162.06157 milliseconds
Gemini-to-HTML Time
0.433012 milliseconds

This content has been proxied by September (ba2dc).