homepage Welcome to WebmasterWorld Guest from 54.242.200.172
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Global mod_rewrite
using mod_rewrite to pass all urls into one script.
killroy




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

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




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved