Project

General

Profile

Actions

Bug #582

closed

Incomplete rewritten URL completed incorrectly

Added by Anonymous about 18 years ago. Updated about 18 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_rewrite
Target version:
-
ASK QUESTIONS IN Forums:

Description

Take an example like this:


    url.rewrite-once = ("^/cookbook/(.*)$" => "/$1")

Now I create a directory "javascript" in my document root.

When I try to access http://www.example.com/cookbook/javascript , it redirects me to http://www.example.com/javascript/ . That's unexpected. Rewriting should be a process internal to the server; the rewritten URL should never be communicated to the user in any way.

If I set up something similar in Apache 2.2.0...


    RewriteEngine On
    RewriteRule ^/cookbook/(.*)$ /$1

...accessing http://www.example.com/cookbook/javascript redirects me to http://www.example.com/cookbook/javascript/ as expected.

-- ryandesign

Actions #1

Updated by conny about 18 years ago

  • Status changed from New to Fixed
  • Resolution set to duplicate

The "internal" destination URL "www.example.com/javascript" results in a 30x Redirect status when the backend server tells the client to add a slash at the end, since it is requesting a directory. The resulting "www.example.com/javascript/" (<-- slash) is what is returned.

What you are describing is a variant of #432, where a patch is available.

Actions

Also available in: Atom