Rewrite fetch file flag?

Discussion in 'General' started by Marcus, Jan 7, 2009.

  1. Marcus

    Marcus Well-Known Member


    I was wondering whether there's an option with the rewrite rules to completely stop all rewrites and try to fetch the file. My current (context-specific) rewrite rules are:

    RewriteCond %{REQUEST_URI} .shtml$
    RewriteRule .* - [L]

    RewriteCond %{HTTP_COOKIE} lang=(en|fr|tr)
    RewriteRule ^(.*)$ $1/%1.shtml [L]

    RewriteRule ^(.*)$ $1/en.shtml [L]

    The reason why the first rule is in there is because the two lower rules (which just select an SSI file from a list of languages) redirects the request back to the same directory, and the rewrite rules are read again.

    I'd like something like

    RewriteCond %{HTTP_COOKIE} lang=(en|fr|tr)
    RewriteRule ^(.*)$ $1/%1.shtml

    RewriteRule ^(.*)$ $1/en.shtml

    Where a flag would be something like 'break', and would then immediately look on the filesystem or check for script handlers.

    If this isn't currently possible, could this be added?
  2. mistwang

    mistwang LiteSpeed Staff

    You can put the rewrite rule at vhost level instead of context level, vhost level rewrite rules is more likely to be processed only once.

Share This Page