Received: (qmail 7994 invoked by uid 501); 30 Oct 2001 15:34:50 -0000 Message-Id: <20011030153450.7993.qmail@apache.org> Date: 30 Oct 2001 15:34:50 -0000 From: Alexander Moiseenko Reply-To: shoom@ru.ru To: submit@bugz.apache.org Subject: ReWrite mod doesn't work correctly on WIN32 X-Send-Pr-Version: 3.110 >Number: 8637 >Category: mod_rewrite >Synopsis: ReWrite mod doesn't work correctly on WIN32 >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Tue Oct 30 07:40:01 PST 2001 >Closed-Date: Tue Oct 30 20:57:07 PST 2001 >Last-Modified: Tue Oct 30 20:57:07 PST 2001 >Originator: shoom@ru.ru >Release: 1.3.20 for win32 >Organization: >Environment: Windows 98 SE >Description: Anybody use mod_rewrite on windows - it's working terrible. Look at this example. I add two strings in my httpd.conf to show log of rewrite RewriteLog C:/rewrite.txt RewriteLogLevel 9 the relevant part of my httpd.conf: ------------------------------------------------------------ # Example: # LoadModule foo_module modules/mod_foo.so # #LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule mime_magic_module modules/mod_mime_magic.so #LoadModule status_module modules/mod_status.so #LoadModule info_module modules/mod_info.so #LoadModule speling_module modules/mod_speling.so LoadModule rewrite_module modules/mod_rewrite.so #LoadModule anon_auth_module modules/mod_auth_anon.so #LoadModule dbm_auth_module modules/mod_auth_dbm.so #LoadModule digest_auth_module modules/mod_auth_digest.so #LoadModule digest_module modules/mod_digest.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule cern_meta_module modules/mod_cern_meta.so #LoadModule expires_module modules/mod_expires.so #LoadModule headers_module modules/mod_headers.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule unique_id_module modules/mod_unique_id.so LoadModule php4_module c:/php/sapi/php4apache.dll # # Reconstruction of the complete module list from all available modules # (static and shared ones) to achieve correct module execution order. # # The modules listed below, without a corresponding LoadModule directive, # are static bound into the standard Apache binary distribution for Windows. # # Note: The order in which modules are loaded is important. Don't change # the order below without expert advice. # # [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE, UPDATE THIS TOO!] ClearModuleList #AddModule mod_vhost_alias.c AddModule mod_env.c AddModule mod_log_config.c #AddModule mod_mime_magic.c AddModule mod_mime.c AddModule mod_negotiation.c #AddModule mod_status.c #AddModule mod_info.c AddModule mod_include.c AddModule mod_autoindex.c AddModule mod_dir.c AddModule mod_isapi.c AddModule mod_cgi.c AddModule mod_asis.c AddModule mod_imap.c AddModule mod_actions.c #AddModule mod_speling.c AddModule mod_userdir.c AddModule mod_alias.c AddModule mod_rewrite.c AddModule mod_access.c AddModule mod_auth.c #AddModule mod_auth_anon.c #AddModule mod_auth_dbm.c #AddModule mod_auth_digest.c #AddModule mod_digest.c #AddModule mod_proxy.c #AddModule mod_cern_meta.c #AddModule mod_expires.c #AddModule mod_headers.c #AddModule mod_usertrack.c #AddModule mod_unique_id.c AddModule mod_so.c AddModule mod_setenvif.c # # ExtendedStatus controls whether Apache will generate "full" status # information (ExtendedStatus On) or just basic information (ExtendedStatus # Off) when the "server-status" handler is called. The default is Off. # #ExtendedStatus On ### Section 2: 'Main' server configuration # # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a # definition. These values also provide defaults for # any containers you may define later in the file. # # All of these directives may appear inside containers, # in which case these default settings will be overridden for the # virtual host being defined. # # # Port: The port to which the standalone server listens. Certain firewall # products must be configured before Apache can listen to a specific port. # Other running httpd servers will also interfere with this port. Disable # all firewall, security, and other services if you encounter problems. # To help diagnose problems use the Windows NT command NETSTAT -a # Port 80 # # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. # ServerAdmin admin@localhost # # ServerName allows you to set a host name which is sent back to clients for # your server if it's different than the one the program would get (i.e., use # "www" instead of the host's real name). # # Note: You cannot just invent host names and hope they work. The name you # define here must be a valid DNS name for your host. If you don't understand # this, ask your network administrator. # If your host doesn't have a registered DNS name, enter its IP address here. # You will have to access it by its address (e.g., http://123.45.67.89/) # anyway, and this will make redirections work in a sensible way. # # 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your # machine always knows itself by this address. If you use Apache strictly for # local testing and development, you may use 127.0.0.1 as the server name. # ServerName localhost # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "C:/www" # # Each directory to which Apache has access, can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). # # First, we configure the "default" to be a very restrictive set of # permissions. # Options FollowSymLinks AllowOverride None #Rewrite Engine Debug RewriteLog C:/rewrite.txt RewriteLogLevel 9 # # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. # # # This should be changed to whatever you set DocumentRoot to. # # # This may also be "None", "All", or any combination of "Indexes", # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews". # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # Options All MultiViews # # This controls which options the .htaccess files in directories can # override. Can also be "All", or any combination of "Options", "FileInfo", # "AuthConfig", and "Limit" # AllowOverride All # # Controls who can get stuff from this server. # Order allow,deny Allow from all ------------------------------------------------------------ .htaccess listing ------------------------------------------------------------ RewriteEngine On RewriteRule ^first\.html$ second.html ------------------------------------------------------------ And look at this. It is Mod ReWrite Log file: ------------------------------------------------------------ 127.0.0.1 - - [30/Oct/2001:10:56:58 +0300] [localhost/sid#65628c][rid#6f878c/initial] (3) [per-dir c:/www/] strip per-dir prefix: c:/www/first.html -> first.html 127.0.0.1 - - [30/Oct/2001:10:56:58 +0300] [localhost/sid#65628c][rid#6f878c/initial] (3) [per-dir c:/www/] applying pattern '^first\.html$' to uri 'first.html' 127.0.0.1 - - [30/Oct/2001:10:56:58 +0300] [localhost/sid#65628c][rid#6f878c/initial] (2) [per-dir c:/www/] rewrite first.html -> second.html 127.0.0.1 - - [30/Oct/2001:10:56:58 +0300] [localhost/sid#65628c][rid#6f878c/initial] (3) [per-dir c:/www/] add per-dir prefix: second.html -> c:/www/second.html 127.0.0.1 - - [30/Oct/2001:10:56:58 +0300] [localhost/sid#65628c][rid#6f878c/initial] (3) [per-dir c:/www/] add per-dir prefix: c:/www/second.html -> c:/www/c:/www/second.html ------------------------------------------------------------ >How-To-Repeat: Try to use mod_rewrite on apache win32 realease >Fix: I think patch or rebuild must help. >Release-Note: >Audit-Trail: Comment-Added-By: wrowe Comment-Added-When: Tue Oct 30 20:55:58 PST 2001 Comment-Added: Fixed in 2.0.27, which is not yet announced. Please test and report back once that version is made available... it will be announced through the usual channels, possibly early next week. State-Changed-From-To: open-closed State-Changed-By: wrowe State-Changed-When: Tue Oct 30 20:57:07 PST 2001 State-Changed-Why: ment to close that report. >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]