problem with rewrite & 404 error

Discussion in 'Install/Configuration' started by xinn, Jun 14, 2006.

  1. xinn

    xinn New Member

    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:

    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
    ( 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
  2. mistwang

    mistwang LiteSpeed Staff

    I think you probably did not configure the listener to vhost mapping properly, you should use "*" or "*.example.com" as the matching domain.
  3. xinn

    xinn New Member

    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
  4. mistwang

    mistwang LiteSpeed Staff

    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.
  5. xinn

    xinn New Member

    For working subdomain:

    And if there is no website set:

    Customized Error Pages:
    404 Not Found http://example.com/index.html
  6. mistwang

    mistwang LiteSpeed Staff

    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.
  7. xinn

    xinn New Member

    Hello,

    It works perfectly, thank you very much

Share This Page