S
S
skyfly20102015-12-29 13:33:53
htaccess
skyfly2010, 2015-12-29 13:33:53

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]

If you have any ideas, please tell me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Zelensky, 2015-12-29
@SergeyZelensky-Rostov

RewriteRule ^bla/id/([\\/_A-Za-z0-9-]+)/?$  index.php?id=$1 [NC,L]

A
Anton Dzodzikov, 2015-12-30
@DzodzikovAK

www.htaccess-guide.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question