If you think it could be useful
When the first request is rewritten to 'allocator.php?...',the new request is, too, parsed over the rewrite-rule. becouse of the rewrite ignores everything after and including a '?' in the requested uri, the uri the rewriter is called with the url './allocator.php?./allocator.php', what is rewritten to './allocator.php?./allocator.php' what is rewritten... so there should be an infinite loop. but the rewriting-engine stops such a loop after a certain loops (by default 10). so after 10 loops the url is finally passed through - with './allocator.php' passed tho the allocator.
You can see this writing an rewritelog by specifying sth. like
- Code: Select all
RewriteLog d:/www/_logs/www.dynacms.home.rewrite.log
RewriteLogLevel 9
in your apache-config (it wont work in an .htaccess and produce an 500-Error)
So what to do?
Its as simple as the problem seemd to be: set a Rewrit-Condition.
In this case that means:
- Code: Select all
RewriteCond %{REQUEST_URI} !.*allocator.php$
RewriteRule ^(.*)$ "./_compiler/allocator.php?$1" [L]
But then i got another problem: i got two directories ('_admin' and '_dynamic') i want to leave out from beeing rewritten. The solution for this? write two other Contitions like this:
- Code: Select all
RewriteCond %{REQUEST_URI} !.*allocator.php$
RewriteCond %{REQUEST_URI} !_admin.*
RewriteCond %{REQUEST_URI} !_dynamic.*
RewriteRule ^(.*)$ "./_compiler/allocator.php?$1" [L]
And well - it works.
Another benefit - calls to any file (except allocator.php, of course) under './_compiler/', where some internal scripts are placed, are redirected to the allocator, too.
Hope it helps some other beginners like me,
Peter