Z
Z
zooks2014-05-22 08:07:58
PHP
zooks, 2014-05-22 08:07:58

How to set php htaccess options to a readable path?

Good morning everyone!
Paths changed on the site:
/dir/?subdir=123
to
/dir/subdir123
But the following line in .htaccess doesn't work:

RewriteRule ^dir/\?subdir=(.+)$ dir/subdir$1 [R=301,L]

Please tell me where is the mistake.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
German Zvonchuk, 2014-05-22
@zooks

RewriteCond %{QUERY_STRING} ^subdir=([0-9]*)$
RewriteRule ^dir$ /dir/subdir/%1 [R=301,L]
Probably something like that.

L
Lubaev, 2014-05-22
@Lubaev

query string is not parsed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question