Forum Moderators: phranque
My scripting language wirks similar to php.
scripts are .htag and interpreter is htag/htag.exe
basically, I want to redirect all urls to
/index.htag/original_url
So far I've used this rule:
RewriteRule ^/(index\.htag/)?([^.]+)$ /index.htag/$2 [L]
by matching only strigns without dots I can still use standard filename references and it doesn't recurse.
My problem is that now I wanted to allow dots as well. So I need a check that prevents infiniet recursion once the index.htag is inserted.
I hope a
RewriteCond %{REQUEST_URI} !^/index\.htag.*
RewriteRule ^(/.+)$ /index.htag$1 [L]
would do it, only rewriting addresses that don't include the index.htag.
But in teh rewrite log (still causeing infinite recursion)
I get the following key items:
[rid#2ce2220/initial] (2) rewrite /wwscentral/xxx.html -> /index.htag/wwscentral/xxx.html
Which is waht I want,
but
[rid#2ce3470/initial/redir#1] (4) RewriteCond: input='/htag/htag.exe/wwscentral/xxx.html' pattern='!^/index\.htag.*' => matched
[rid#2ce3470/initial/redir#1] (2) rewrite /htag/htag.exe/wwscentral/xxx.html -> /index.htag/htag/htag.exe/wwscentral/xxx.html
Which keeps bringing the address around like this:
[rid#2ce4248/initial/redir#2] (2) init rewrite engine with requested uri /htag/htag.exe/htag/htag.exe/wwscentral/xxx.html
and never stops.
What am I missing? how can I prevent the script lookups to rewrite too?
Thanks
SN
Here are sugestions that people gave me.
[webmasterworld.com...]
Also note, you can set apache's documentroot to be a script instead of a directory!
so if you use
<VirtualHost 123.12.12.1>
ServerName my.domain.com
DocumentRoot "/some/directory/myspecialprogram.htag"
</VirtualHost>
Then any requests such as my.domain.com/blah
will be handeled by that program.