R
R
RastaZ2019-03-06 18:00:45
Apache HTTP Server
RastaZ, 2019-03-06 18:00:45

How to limit an expression to 7 characters in mod_rewire?

Rule!

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^.+\/&
RewriteRule ^([^/]*{7})$ /go\?id\=$1 [L]

As a result, it gives an error! And {0,7} too! I don’t know what to do, what are other regular expressions in general

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-03-06
@RastaZ

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]{0,7})$ /go?id=$1 [L]

V
Viktor Taran, 2019-03-06
@shambler81

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(+{1,7})$ /go\?id\=$1 [L]
Character 1 from one to 7 times
And who will escape special characters for you?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question