I have the following setup:

/register (for default user registration, which shall be disabled)
/businessRegisterForm (for some form of user registration, which shall be enabled)
/register/saveRegister/* (targets of businessRegisterForm, shall be enabled)
/account (rewritetarget of /register)
now I tried various htaccess rewriteConds to rewrite /register to /account IF it’s not followed by /saveRegister, but don’t get it to work (either got HTTP/500 or always redirected or never redirected).

does someone know the condition and rewrite syntax?


I’m using the “shopware” framework, which has the following default rules (taken from a demo instance):

RewriteEngine on

RewriteBase /sw_demo/

RewriteRule shopware.dll shopware.php
RewriteRule files/documents/.* engine [NC,L]
RewriteRule backend/media/(.*) media/$1 [NC,L]

RewriteCond %{REQUEST_URI} !(/(engine|files|templates)/)
RewriteCond %{REQUEST_URI} !(/media/(archive|banner|image|music|pdf|unknown|video)/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ shopware.php [PT,L,QSA]

What I tried is inserting the following combinations between RewriteRule backend/media/(.*) media/$1 [NC,L] and RewriteCond %{REQUEST_URI} !(/(engine|files|templates)/):

RewriteCond %{REQUEST_URI} !saveRegister
RewriteRule register account [NC,L]
=> not being redirected
RewriteCond %{REQUEST_URI} !(/saveRegister)
RewriteRule /register /account [L] => also not being redirected
unfortunately I’m unable to reproduce the case always redirecting me, and fortunately, I’m not generating HTTP/500s anymore

Read more here: htaccess mod_rewrite exclude


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: