qwqewew
qwqewew

Reputation: 1

.htaccess problem in php

This block is in my .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]

i want to add following block with my .htaccess, both block run correctly but cant work together

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

SO i want both block into my htaccess so how can i combined it? Thank You

Upvotes: 0

Views: 57

Answers (1)

Anatolij
Anatolij

Reputation: 607

You need to remove L from you first RewriteRule ^.*$ /index.php [NC,L]. Because L is the last rule.

'last|L' (last rule)
Stop the rewriting process here and don't apply any more rewriting rules. This corresponds to the Perl last command or the break command from the C language. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/') to a real one, e.g., '/e/www/'.

Upvotes: 1

Related Questions