>Number: 2810 >Category: mod_rewrite >Synopsis: Rewrite rule: RewriteRule ^/somepath(.*) >http://fully.qualified.domain/anypath$1 [P] does not work. >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Aug 7 14:40:01 PDT 1998 >Last-Modified: >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.3.1 >Environment: Windows NT4.0 Service Pack3. >Description: I am trying to remap to an external location via RewriteRule ^/somepath(.*) http://fully.qualified.domain/anypath$1 [P] as noted in your documentation. It occasionally works, but it just seems to depend on it's mood. It usually doesn't work. This is set in my httpd.conf file:
# This is the main server configuration file. See URL http://www.apache.org/ # for instructions. # Do NOT simply read the instructions in here without understanding # what they do, if you are unsure consult the online docs. You have been # warned. # Originally by Rob McCool # Note: Where filenames are specified, you must use forward slashes # instead of backslashes. e.g. "c:/apache" instead of "c:\apache". If # the drive letter is ommited, the drive where Apache.exe is located # will be assumed # ServerType must be standalone. ServerType standalone # # The following lists extra modules that can be uncommented to be loaded # to enable extra functionality. See the manual # (http://www.apache.org/docs/mod/) for details on the functionality # of each module. # #LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll #LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll #LoadModule digest_module modules/ApacheModuleDigest.dll #LoadModule expires_module modules/ApacheModuleExpires.dll #LoadModule headers_module modules/ApacheModuleHeaders.dll #LoadModule proxy_module modules/ApacheModuleProxy.dll LoadModule rewrite_module modules/ApacheModuleRewrite.dll #LoadModule speling_module modules/ApacheModuleSpeling.dll #LoadModule status_module modules/ApacheModuleStatus.dll #LoadModule usertrack_module modules/ApacheModuleUserTrack.dll # Port: The port the standalone listens to. Port 80 # HostnameLookups: Log the names of clients or just their IP numbers # e.g. www.apache.org (on) or 204.62.129.132 (off) # The default is off because it'd be overall better for the net if people # had to knowingly turn this feature on. HostnameLookups off # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # ServerAdmin: Your address, where problems with the server should be # e-mailed. ServerAdmin [EMAIL PROTECTED] # ServerRoot: The directory the server's config, error, and log files # are kept in ServerRoot "C:/Program Files/Apache Group/Apache" # BindAddress: You can support virtual hosts with this option. This option # is used to tell the server which IP address to listen to. It can either # contain "*", an IP address, or a fully qualified Internet domain name. # See also the VirtualHost directive. #BindAddress * # ErrorLog: The location of the error log file. If this does not start # with /, ServerRoot is prepended to it. ErrorLog logs/error.log # LogLevel: Control the number of messages logged to the error.log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn # The following directives define some format nicknames for use with # a CustomLog directive (see below). LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent # The location of the access logfile (Common Logfile Format). # If this does not start with /, ServerRoot is prepended to it. CustomLog logs/access.log common # If you would like to have an agent and referer logfile uncomment the # following directives. #CustomLog logs/referer.log referer #CustomLog logs/agent.log agent # If you prefer a single logfile with access, agent and referer information # (Combined Logfile Format) you can use the following directive. #CustomLog logs/access.log combined # PidFile: The file the server should log its pid to PidFile logs/httpd.pid # ScoreBoardFile: File used to store internal server process information. # Not all architectures require this. But if yours does (you'll know because # this file is created when you run Apache) then you *must* ensure that # no two invocations of Apache share the same scoreboard file. ScoreBoardFile logs/apache_status # 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. #ServerName new.host.name # UseCanonicalName: (new for 1.3) With this setting turned on, whenever # Apache needs to construct a self-referencing URL (a url that refers back # to the server the response is coming from) it will use ServerName and # Port to form a "canonical" name. With this setting off, Apache will # use the hostname:port that the client supplied, when possible. This # also affects SERVER_NAME and SERVER_PORT in CGIs. UseCanonicalName on # CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each # document that was negotiated on the basis of content. This asks proxy # servers not to cache the document. Uncommenting the following line disables # this behavior, and proxies will be allowed to cache the documents. #CacheNegotiatedDocs # Timeout: The number of seconds before receives and sends time out Timeout 300 # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. KeepAlive On # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We reccomend you leave this number high, for maximum performance. MaxKeepAliveRequests 100 # KeepAliveTimeout: Number of seconds to wait for the next request KeepAliveTimeout 15 # Apache always creates one child process to handle requests. If it # dies another child process is created automatically. Within the # child process multiple threads handle incoming requests. The next two # directives determine the behaviour of the threads and processes. # Don't force a server to exit after it has served some number of requests. # If you do want server's to exit after they have run for a long time (to # help the system clean up after the process), please set this to a pretty # large number - like 10,000. What this will do, is, each child server will # exit after serving 10,000 requests, and another server will take its place. MaxRequestsPerChild 0 # Number of concurrent threads at a time (set the value to more or less # depending on the responsiveness you want and the resources you wish # this server to consume). ThreadsPerChild 50 # Proxy Server directives. Uncomment the following line to # enable the proxy server: #ProxyRequests On # To enable the cache as well, edit and uncomment the following lines: #CacheRoot "C:/Program Files/Apache Group/Apache/proxy" #CacheSize 5 #CacheGcInterval 4 #CacheMaxExpire 24 #CacheLastModifiedFactor 0.1 #CacheDefaultExpire 1 #NoCache a_domain.com another_domain.edu joes.garage_sale.com # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, in addition to the default. See also the VirtualHost command #Listen 3000 #Listen 12.34.56.78:80 # VirtualHost: Allows the daemon to respond to requests for more than one # server address, if your server machine is configured to accept IP packets # for multiple addresses. This can be accomplished with the ifconfig # alias flag, or through kernel patches like VIF. # Any httpd.conf or srm.conf directive may go into a VirtualHost command. # See also the BindAddress entry. #<VirtualHost host.some_domain.com> #ServerAdmin [EMAIL PROTECTED] #DocumentRoot /www/docs/host.some_domain.com #ServerName host.some_domain.com #ErrorLog logs/host.some_domain.com-error.log #TransferLog logs/host.some_domain.com-access.log #</VirtualHost> RewriteEngine on RewriteRule ^/restest(.*) http://home1.gte.net/restest$1 [P] >How-To-Repeat: See above. >Fix: No idea. >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include <[EMAIL PROTECTED]> in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [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! ]
