Reputation: 8701
There are 2 .htaccess
files, one in /
and the second in /web
folders.
In a root folder (/
), .htaccess
looks like
RewriteEngine on
RewriteRule ^$ web/ [L]
RewriteRule (.*) web/$1 [L]
In /web
folder, .htaccess
looks like
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
It works perfectly.
All I want is to merge those conditions and put them inside a single .htaccess
that would be in root directory (/
).
RewriteBase
, likeRewriteBase /web
RewriteRule ^(.*)$ web/index.php/$1 [QSA,L]
But none of this works - It gives internal 500 server error.
How a proper merging should be done in this case?
Upvotes: 0
Views: 39
Reputation: 68790
This .htaccess
(in the root folder) should match to your needs :
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web/index.php/$1 [QSA,L]
Upvotes: 2
Reputation: 143896
If you're putting all the rules in your document root (/
) then try:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /web/index.php/$1 [QSA,L]
Upvotes: 1