Rewrite Rules

Discussion in 'General' started by tristanlee85, Jan 17, 2009.

  1. tristanlee85

    tristanlee85 New Member

    I am trying to set up a duplicated server that originally ran on a Windows machine and ISAPI Rewrite rules over to work on my FC7 machine. Here is the rules for ISAPI_Rewrite:

    Code:
    RewriteEngine on
    
    
    
    RewriteCond %{HTTP_HOST} ^.?\.local$ [NC]
    
    RewriteRule (.*) /core/index\.cfm?pagepath=/ [L]
    
    
    
    RewriteRule ^/favicon\.ico /core/favicon\.ico [L]
    
    RewriteRule ^/shortcuticon\.ico /core/shortcuticon\.ico [L]
    
    
    
    RewriteCond %{REQUEST_URI} !^/(admin|core|docs|sitecheck|ssl|scripts|cfcflexplorer|flex2gateway|flashservices|cfide|cfformgateway|com|UserUploadedEditor|SpecialReports|PDFIssues|contentUploadedByEweb|_loadTesting)($|/) [NC]
    
    
    
    #just in case u are trying to rewrite our param
    
    RewriteCond %{QUERY_STRING} !pagepath [NC]	
    
    
    
    RewriteCond %{QUERY_STRING} ^(.*)$ 
    
    RewriteRule ^([^\?]*)\??(.*)  core/index.cfm?pagepath=/$1&%1 [L]
    Now I believe these are the same for mod_rewrite so I had copied them into the Apache Directives field on the subdomain I am using, but I am getting a 400 Bad Request error. Did I put these rules in the wrong location or are the rules not compatible with what I am doing?
     
    Last edited: Jan 17, 2009
  2. falko

    falko Super Moderator Howtoforge Staff

    What's in Apache's error log and the web site's error log?
     
  3. tristanlee85

    tristanlee85 New Member

    Code:
    [root@ns1 ~]# tail -f /var/www/web7/log/error.log 
    [Sat Jan 17 16:46:04 2009] [error] [client 173.88.114.132] File does not exist: /var/www/web7/web/favicon.ico
    [Sat Jan 17 16:46:04 2009] [error] [client 173.88.114.132] File does not exist: /var/www/web7/web/favicon.ico
    [Sat Jan 17 18:10:24 2009] [error] [client 173.88.114.132] Directory index forbidden by Options directive: /var/www/web7/web/
    [Sat Jan 17 18:10:24 2009] [error] [client 173.88.114.132] File does not exist: /var/www/web7/web/error/noindex.html
    [Tue Jan 20 20:14:04 2009] [error] [client 173.88.126.98] Invalid URI in request GET / HTTP/1.1
    [Tue Jan 20 20:14:04 2009] [error] [client 173.88.126.98] Invalid URI in request GET / HTTP/1.1
    [Tue Jan 20 20:14:36 2009] [error] [client 173.88.126.98] File does not exist: /var/www/web7/web/favicon.ico
    [Thu Jan 29 23:11:26 2009] [error] [client 173.88.126.98] Invalid URI in request GET / HTTP/1.1
    [Thu Jan 29 23:11:26 2009] [error] [client 173.88.126.98] Invalid URI in request GET / HTTP/1.1
    [Thu Jan 29 23:12:17 2009] [error] [client 173.88.126.98] File does not exist: /var/www/web7/web/favicon.ico
    
    Code:
    [root@ns1 ~]# tail -f /var/log/httpd/error_log
    [Thu Jan 29 23:17:54 2009] [notice] mod_python: using mutex_directory /tmp 
    [Thu Jan 29 23:17:54 2009] [notice] jrApache[init]  JRun 4.0 (Build 108487) Apache 2.2 module - Jun 21 2007 14:44:05
    [Thu Jan 29 23:17:54 2009] [notice] Apache/2.2.8 (Unix) DAV/2 PHP/5.2.6 mod_python/3.3.1 Python/2.5 mod_ssl/2.2.8 OpenSSL/0.9.8b JRun/4.0 mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations
    [Thu Jan 29 23:20:49 2009] [notice] SIGHUP received.  Attempting to restart
    [Thu Jan 29 23:20:49 2009] [notice] Digest: generating secret for digest authentication ...
    [Thu Jan 29 23:20:49 2009] [notice] Digest: done
    [Thu Jan 29 23:20:49 2009] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
    [Thu Jan 29 23:20:49 2009] [notice] mod_python: using mutex_directory /tmp 
    [Thu Jan 29 23:20:49 2009] [notice] jrApache[init]  JRun 4.0 (Build 108487) Apache 2.2 module - Jun 21 2007 14:44:05
    [Thu Jan 29 23:20:49 2009] [notice] Apache/2.2.8 (Unix) DAV/2 PHP/5.2.6 mod_python/3.3.1 Python/2.5 mod_ssl/2.2.8 OpenSSL/0.9.8b JRun/4.0 mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations
    
    These logs are after about 20 page requests that result in a 400 Bad Request.
     

Share This Page