Topic: Last rule doesn’t seem to take effect
|

|
| Author |
|
rewriter007 Newbie

Joined: 15 April 2011
Online Status: Offline Posts: 1
|
| Posted: 15 April 2011 at 10:36pm | IP Logged
|
|
|
I've been messing with this all day and can't figure out the exact cause.
My earlier rules file with ISAPI rewrite 3 worked fine but fails to work on
APE with Win2008.
First of all, it doesn’t look like the RewriteCond followed by a RewriteRule
works very well - at least that’s the impression I got from the other posts
on the forum - since the advice always seems to be to convert it into a
rewrite rule.
Below is a snippet and the commented out part didn’t work (but used to
work with ISAPI rewrite) and the RewriteRule worked. (i.e. The upper block
is what I need to figure out. The second block used to work but is now
commented and replaced by the third block of code).
Right now, I cant figure out how to convert the "admin" URLs to the
RewriteRule. Also, I should mention that the "L" flag doesn’t seem to
really take effect - it still seems to loop over on the same rules despite
not having a redirect - but if I throw an "F" flag, it stops immediately.
Code:
#RewriteCond %{REQUEST_URI} ^/(admin) [NC]
#RewriteCond %{REQUEST_URI}
!^/admin/(index.cfm|test|assets|services|controllers|layouts|views) [NC]
#RewriteRule ^admin/(.*)$ /admin/index.cfm/$1 [NC,L,QSA]
#RewriteCond %{REQUEST_URI}
!^/(admin|assets|blog|cfide|cffileservlet|email|files|images|js|css|views|la
youts|controllers|services|index.cfm|sitemap.xml|robots.txt|product-
feed.xml|LiveSearchSiteAuth.xml|BingSiteAuth.xml|[y_key|google]
(.*).html) [NC]
#RewriteRule ^(.*)$ /index.cfm/$1 [NC,L,QSA]
RewriteRule ^(?!
(?:admin|assets|blog|cfide|cffileservlet|email|files|images|js|css|views|lay
outs|controllers|services|index.cfm|sitemap.xml|robots.txt|product-
feed.xml|LiveSearchSiteAuth.xml|BingSiteAuth.xml|[y_key|google]
(.*).html)/.*)(.*)$ /index.cfm/$2 [NC,L,QSA]
xxx |
|
|
|
| Back to Top |
|
| |
Vyacheslav Admin Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 1542
|
| Posted: 18 April 2011 at 3:53am | IP Logged
|
|
|
Hello.
Regular expressions syntax seems incorrect in all the cases. Please use the following example:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^(.*?(?:admin|layouts|index\.cfm).*)$ [NC]
RewriteRule .? /index\.cfm%1 [NC,L,NS]
|
|
|
We can also design rules for you. Please consider to use commercial support.
The Troubleshooting section of the documentation might help you to understand why things don’t work as expected.
Thank you.
__________________ Slavik Shynkarenko,
Helicon Tech.
|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You can vote in polls in this forum
|