C
C
cyber12014-05-02 12:52:48
PHP
cyber1, 2014-05-02 12:52:48

Problem with rewiterule creation

Cannot create rewriterule:
site.ru/?do=servers&50_craft=50_craft&active_admins=active_admins&airdrop=airdrop&no_sleepers=no_sleepers&oxide=oxide&sethome=sethome&tpa=tpa
Or
site.ru/?do=servers&tag1=50_craft&tag2=active_admins&tag3=airdrop&tag4=no_sleepers&tag5=oxide&tag6=sethome You
should get something like this:
site.ru/servers/50_craft-active_admins-airdrop-no_sleepers-oxide-sethome-tpa
The number of tags will change.
I have already seen something similar here: monitoringminecraft.ru/servera-creative-bez-whitel...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
m-haritonov, 2014-05-02
@cyber1

RewriteEngine on

RewriteCond %{QUERY_STRING} ^(do=.*)$
RewriteRule .* /%1?

RewriteRule ^(.*?)&tag[0-9]+=(.*)$ /$1-$2 [N]
RewriteRule ^do=(.*?)-(.*)$ /$1/$2 [R=302,L]

Accessing the URL:
Will result in a redirect to:
/servers/50_craft-active_admins-airdrop-no_sleepers-oxide-sethome-tpa

S
svd71, 2014-05-02
@svd71

and what prevents you from redirecting to a php script, processing the request, rewriting it to the right one and loading the required page?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question