I have an instalation on my htdocs folder that needs rewriterules to be processed like this:
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteCond %{REQUEST_URI} !^/admin?
RewriteCond %{REQUEST_URI} !^/payment?
RewriteRule ^(.*)$ %1/$1 [QSA]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^admin/(.*)?$ BACKEND-PHP/$1?domain=%1 [QSA]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^payment/(.*)?$ PAYPAL-API/$1?domain=%1 [QSA]
But now, to test joomla i need add some rule in the htaccess file that stop processing rules if the given directory is "localhost/joomla" in order to joomla work properly.
in pseudocode will be like this:
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} ^$
**RewriteCond %{HTTP_HOST} ^(localhost)$
**RewriteRule ^/joomla$ [END]
# (if the requested file is at joomla directory
# htaccess will stop processing)
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteCond %{REQUEST_URI} !^/admin?
RewriteCond %{REQUEST_URI} !^/payment?
RewriteRule ^(.*)$ %1/$1 [QSA]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^admin/(.*)?$ BACKEND-PHP/$1?domain=%1 [QSA]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^payment/(.*)?$ PAYPAL-API/$1?domain=%1 [QSA]
You were close. Just modify your rules to
RewriteCond %{HTTP_HOST} ^localhost$ [NC]
RewriteRule ^joomla(/.*)?$ - [END]
The - says we do no processing on this URL. The [End] flag prevents all the rules below from firing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With