A
A
avtorlego2018-02-05 23:12:25
htaccess
avtorlego, 2018-02-05 23:12:25

How to change htaccess redirect path?

there is htacess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?act=/$1 [QSA,L]
needed: if there is more than one / in the path, then do not redirect.
Like - site.com/test - redirect, site.com/test/tost, do not touch it already.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2018-02-06
@shambler81

RewriteEngine On
RewriteCond %{REQUEST_URI} ! тут ваше выражение
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?act=/$1 [QSA,L]

Now about the second slash.
1. [^/]- except for the slash, respectively, (.+[^/]) will be before the first slash, and so on
2. Read about greedy and lazy quantifiers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question