htaccess-for-nginx icon indicating copy to clipboard operation
htaccess-for-nginx copied to clipboard

Wrong RewriteRul when have more .htaccess file in subdirectory

Open proginter opened this issue 2 years ago • 0 comments

Hi,

I have .htaccess file on root path with this content:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

I have more .htaccess file in 'root path'/style/both/addons/minify with this content:

RewriteEngine on
# rewrite URLs like "/min/f=..." to "/min/?f=..."
RewriteRule ^([bfg]=.*) index.php?$1 [L,NE]

When I go to: https://XXX.com/style/both/addons/minify/b=style/both/js&f=json.js,jquery.js,jqbrowser.js,jquery.numeric.js,jquery.form.min.js,jquery.actual.min.js,jquery.throttle.js&nocache=true

The issue is the "ngx.exec(dst)" will execute to wrong url: /index.php?url=style/both/addons/minify/b=style/both/js&f=json.js,jquery.js,jqbrowser.js,jquery.numeric.js,jquery.form.min.js,jquery.actual.min.js,jquery.throttle.js&nocache=true

It should execute this: /style/both/addons/minify/index.php?b=style/both/js&f=json.js,jquery.js,jqbrowser.js,jquery.numeric.js,jquery.form.min.js,jquery.actual.min.js,jquery.throttle.js&nocache=true

proginter avatar Jan 03 '23 12:01 proginter