LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > problem with rewrite & 404 error

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2006, 03:34 PM
xinn xinn is offline
Member
 
Join Date: Aug 2005
Posts: 21
Default problem with rewrite & 404 error

Hello,

I use rewrite rules to set up subdomains. Ive also set up 404 redirection to catch all traffic on currently `unused` subdomains ( ive also set it on in Customized Error Pages section ). Those are the rules which i use:

Quote:
RewriteCond %{SERVER_NAME} !^www\.example\.com$
RewriteCond %{SERVER_NAME} ^(www\.)?([a-z-]+)\.example\.com$
RewriteRule ^/(.*)$ /home/examplecom/public_html/%2/$1
ErrorDocument 404 /home/examplecom/public_html/index.html
The problem is that it only works for a http://example.com . If there is no dir `/home/examplecom/public_html/sss` and i try to access sss.example.com i simply get
Quote:
404 Not Found
The resource requested could not be found on this server! Powered By LiteSpeed Web Server
Lite Speed Technologies is not responsible for administration and contents of this web site!
( The traffic isnt redirected )

Is this a rewrite bug? Why `Customized Error Pages` doesnt work for the all subdomains in this vHost? Is there any way i can fix that or this is a litespeed bug?

Best Regards
Lukasz
Reply With Quote
  #2  
Old 06-14-2006, 06:06 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
I think you probably did not configure the listener to vhost mapping properly, you should use "*" or "*.example.com" as the matching domain.
Reply With Quote
  #3  
Old 06-15-2006, 01:36 AM
xinn xinn is offline
Member
 
Join Date: Aug 2005
Posts: 21
I use `*` so this is not a problem. I didnt mention. It maps the domains.
If there is a directory `test` and i enter test.example.com it will display the site located in /home/examplecom/www/test/.

The problem is only with 404 error redirection
Reply With Quote
  #4  
Old 06-15-2006, 08:19 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
The ErrorDocument directive bolow the rewrite rule does not work, only the vhost customized error page option works.
Can you post some debug logging. one working for example.com, one not working.
Reply With Quote
  #5  
Old 06-15-2006, 09:05 AM
xinn xinn is offline
Member
 
Join Date: Aug 2005
Posts: 21
For working subdomain:

Quote:
2006-06-15 18:00:56.020 [INFO] [myIP:20646-0#example.com] [REWRITE] Rule: Match '/' with pattern '^/(.*)$', result: 2
2006-06-15 18:00:56.020 [INFO] [myIP:20646-0#example.com] [REWRITE] Cond: Match 'tester.example.com' with pattern '^www\.example\.com$', result: -1
2006-06-15 18:00:56.020 [INFO] [myIP:20646-0#example.com] [REWRITE] Cond: Match 'tester.example.com' with pattern '^(www\.)?([a-z-]+)\.example\.com$', result: 3
2006-06-15 18:00:56.020 [INFO] [myIP:20646-0#example.com] [REWRITE] Source URI: '/' => Result URI: '/home/examplepl/public_html/tester/'
2006-06-15 18:00:56.020 [INFO] [myIP:20646-0#example.com] [REWRITE] strip rewrite base: '/' from URI: '/'
2006-06-15 18:00:56.020 [INFO] [myIP:20646-0#example.com] [REWRITE] Rule: Match '' with pattern '^([^.]+)(\.html)?$', result: -1
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Rule: Match '/favicon.ico' with pattern '^/(.*)$', result: 2
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Cond: Match '/favicon.ico' with pattern '^/xstaty', result: -1
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Cond: Match 'tester.example.com' with pattern '^www\.example\.com$', result: -1
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Cond: Match 'tester.example.com' with pattern '^(www\.)?([a-z-]+)\.example\.com$', result: 3
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Source URI: '/favicon.ico' => Result URI: '/home/examplepl/public_html/tester/favicon.ico'
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] strip rewrite base: '/' from URI: '/favicon.ico'
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Rule: Match 'favicon.ico' with pattern '^([^.]+)(\.html)?$', result: -1
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] File not found [/home/examplepl/public_html/tester/favicon.ico]
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Rule: Match '/' with pattern '^/(.*)$', result: 2
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Cond: Match '/favicon.ico' with pattern '^/xstaty', result: -1
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Cond: Match 'tester.example.com' with pattern '^www\.example\.com$', result: -1
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Cond: Match 'tester.example.com' with pattern '^(www\.)?([a-z-]+)\.example\.com$', result: 3
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] Source URI: '/' => Result URI: '/home/examplepl/public_html/tester/'
2006-06-15 18:00:56.613 [INFO] [myIP:20647-0#example.com] [REWRITE] strip rewrite base: '/' from URI: '/'
2006-06-15 18:00:56.614 [INFO] [myIP:20647-0#example.com] [REWRITE] Rule: Match '' with pattern '^([^.]+)(\.html)?$', result: -1
And if there is no website set:

Quote:
2006-06-15 18:02:26.268 [INFO] [myIP:20656-0#example.com] [REWRITE] Rule: Match '/' with pattern '^/(.*)$', result: 2
2006-06-15 18:02:26.268 [INFO] [myIP:20656-0#example.com] [REWRITE] Cond: Match 'sesesese.example.com' with pattern '^www\.example\.com$', result: -1
2006-06-15 18:02:26.268 [INFO] [myIP:20656-0#example.com] [REWRITE] Cond: Match 'sesesese.example.com' with pattern '^(www\.)?([a-z-]+)\.example\.com$', result: 3
2006-06-15 18:02:26.268 [INFO] [myIP:20656-0#example.com] [REWRITE] Source URI: '/' => Result URI: '/home/examplepl/public_html/sesesese/'
2006-06-15 18:02:26.291 [INFO] [myIP:20656-0#example.com] [REWRITE] strip rewrite base: '/' from URI: '/'
2006-06-15 18:02:26.291 [INFO] [myIP:20656-0#example.com] [REWRITE] Rule: Match '' with pattern '^([^.]+)(\.html)?$', result: -1
2006-06-15 18:02:26.291 [INFO] [myIP:20656-0#example.com] File not found [/home/examplepl/public_html/sesesese/]
2006-06-15 18:02:26.291 [ERROR] [myIP:20656-0#example.com] detect loop redirection.
Customized Error Pages:
404 Not Found http://example.com/index.html
Reply With Quote
  #6  
Old 06-17-2006, 07:54 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
The problem is that LSWS cannot found the file used for the error page under the missing subdomain. So it reports "detect loop redirection". You can add a static context /index.html pointing to /home/examplecom/public_html/index.html to fix it.
Reply With Quote
  #7  
Old 06-21-2006, 10:45 AM
xinn xinn is offline
Member
 
Join Date: Aug 2005
Posts: 21
Hello,

It works perfectly, thank you very much
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rewrite Problem Jetro General 6 03-26-2007 01:27 PM
Problem installing ruby-lsapi sfreiberg Install/Configuration 11 10-17-2006 01:56 PM
Php file uploads result in "connection reset" error bazza PHP 7 06-09-2006 12:25 PM
rewrite problem illidan Install/Configuration 4 04-18-2005 03:42 PM
rewrite content limit Channel_Cat Bug Reports 1 09-21-2004 03:37 PM


All times are GMT -7. The time now is 09:48 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.