Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Global mod_rewrite

using mod_rewrite to pass all urls into one script.

     

killroy

12:09 pm on Apr 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I lay out all my websites with a file less directory structure, like this:
/
/page1
/page2
/page1/item1
/page1/item2
/cat1/subcat2/item3

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

eaden

5:03 am on Apr 9, 2003 (gmt 0)

10+ Year Member



I wanted the same thing.

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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month