rewrite problem ?

Discussion in 'Apache Migration/Compatibility' started by art182, Sep 17, 2009.

  1. art182

    art182 New Member

    hello, i have simple rewrite rules


    RewriteRule ^example/(.*)/(.*)$ /x.php?s=example&n=$1&p=$2 [L]
    RewriteRule ^example/(.*)$ /x.php?s=example&n=$1 [L]
    RewriteRule ^ex2/(.*)/(.*)$ /x.php?s=ex2&n=$1&p=$2 [L]
    RewriteRule ^ex2/(.*)$ /x.php?s=ex2&n=$1 [L]

    domain.pl / x.php
    I need rewrite domain.pl/example, domain.pl/ex2 etc.


    why its not working ? ( error 404 )
    on apache is ok.
  2. mistwang

    mistwang LiteSpeed Staff

    You rewrite rule should work, maybe something else.
    Are you using LSWS standard edition with httpd.conf?
  3. art182

    art182 New Member

    no using httpd.conf
    standard edition ( 4.0.10 )
    logs:
  4. mistwang

    mistwang LiteSpeed Staff

    If you copy the rewrite rule from .htaccess to use it at vhost level, you need to add a leading '/', the log shows it as well.
  5. art182

    art182 New Member

    sorry i don't understand ..

    where should I add / ?

    ( could you show me an example? )
  6. NiteWave

    NiteWave Administrator

    RewriteRule ^example/(.*)/(.*)$ /x.php?s=example&n=$1&p=$2 [L]

    ===>

    RewriteRule ^/example/(.*)/(.*)$ /x.php?s=example&n=$1&p=$2 [L]

Share This Page