Hi - I am configuring an ExpressionEngine site on a new server that doesn’t use htaccess to rewrite URLs. I have discovered that a file called rewrite.script in the root directory will remove it with the following code;
map path into SCRATCH:DOCROOT from /
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}
look for file at %{SCRATCH:DOCROOT}%{SCRATCH:REQUEST_URI}
if not exists then look for dir at %{SCRATCH:REQUEST_URI}%{SCRATCH:REQUEST_URI}
if not exists then set URL = /index.php%{SCRATCH:REQUEST_URI}
However, this locks me out of the backend (www.website.com/system) as the backend uses index.php as a default file. How can I exclude this from the above codes?
ExpressionEngine? Isn’t that an M$ product? I’ll move this to the Server board.
Anyway, that code looks like it’s doing something similar to mod_rewrite’s RewriteCond statements when it checks the path/to/file for an existing file or directory then redirects to index.php in the root directory. Therefore, if your index.php file exists in the backend, your requests should not be redirected.
IMHO, if you’re using a new tool like this, your best bet is to use the forum for that tool where others will be complaining about the same thing and it’s likely that one person there has solved the problem you’re having.
You know Zeus have quite extensive documentation with a few examples that cover just this. I’m surprised there are still people using ZWS
See section 8.7 of the ZWS 4.3 user guide (Configuring Request Rewrite Scripts).
map path into SCRATCH:DOCROOT from /
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}
match %{SCRATCH:REQUEST_URI} into $ with ^/system/
if not matched then
look for file at %{SCRATCH:DOCROOT}%{SCRATCH:REQUEST_URI}
if not exists then look for dir at %{SCRATCH:REQUEST_URI}%{SCRATCH:REQUEST_URI}
if not exists then set URL = /index.php%{SCRATCH:REQUEST_URI}
endif
Which should just blanket exclude anything in /system/ from the rewrite.