C
C
Carlyndow Marlifi2021-04-13 12:23:49
htaccess
Carlyndow Marlifi, 2021-04-13 12:23:49

How to allow passing any text to .htaccess variable?

RewriteRule ^page/([a-z]*)/?$ page.php?url=$1 [L,QSA]


If you go to site.ru/page/text # then everything will be fine, but if you
pass characters as text, for example, underscore
site.ru/page/text_text # then the url parameter 'text_text' will not be inserted into page.php as parameter, but just as if the site opens with the following address site.ru/page/text_text and writes that there is no such file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lander, 2021-04-13
@petushok55

Obviously, in your case, you need to change the regular expression:

RewriteRule ^page/([a-z_]*)/?$ page.php?url=$1 [L,QSA]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question