D
D
dani1a2019-08-14 16:55:57
htaccess
dani1a, 2019-08-14 16:55:57

Pass url part in GET to htaccess and also ignore this part, really?

Pass url part in GET to htaccess and also ignore this part. Simply put, there is, let's say, the url domen.ru/moscow/about/, I want moscow to be passed to the GET parameter, for example, city, and at the same time, not /moscow/about/index.php directories were loaded, but /about/index .php (without redirects, but to ignore moscow symbols.
That is, if the url is domen.ru/moscow/about/, then we pass the city GET parameter and the content from /about/ is loaded,
and if the url is domen.ru/about/ , then everything is unchanged and loaded as standard.
At the same time, without redirects. It's just a rule that the city is passed to GET and ignored when loading content. Is it real? If it's real, tell me the rule.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-08-14
@dani1a

RewriteRule ^([^/]+)/about/$ /about/index.php?city=$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question