Answer the question
In order to leave comments, you need to log in
How to create an htaccess rule?
Good afternoon, tell me how to create a rule for htaccess that will allow you to receive url as a variable.
For example mysite.com/bla/id/ google.com/search/12
In this case, it is necessary that on the site mysite.com in the bla directory the id should get the value google.com/search/12
I did it as follows:
RewriteRule ^bla/id/([A-Za-z0-9-]+)/?$ dir/dir/index.php?id=$1 [NC,L]
Answer the question
In order to leave comments, you need to log in
RewriteRule ^bla/id/([\\/_A-Za-z0-9-]+)/?$ index.php?id=$1 [NC,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question