I’m cleaning up some old code and came across a rule in a .htaccess that doesn’t make sense to me.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(/listener/v2/bbin/)
RewriteRule ^(.*)$ /listener/v3/v210_ui.php$1 [L]
This .htaccess file is located in <docroot>/listener/v2/. Unless I’m mistaken, the rule basically is stating that if the request is for a file in this directory, internally redirect it to /listener/v3/v210_ui.php.
My confusion stems from the fact that there are a lot of files in this directory. Am I missing something? Did the old developer just not clean up after themselves?
You’re close…
If the request is for a resource in
/listener/v2/bbin/and has does not start with/listener/v2/bbin/in the URI redirect it to/listener/v3/v210_ui.phpand append the URI.Now why you’re doing this I can’t answer. Read up on
RewriteCond.