Answer the question
In order to leave comments, you need to log in
How to rewrite index.php?param=name to /param/name?
Actually the question itself is in the top. I'm trying to do this:
RewriteEngine On
# RewriteCond %{ENV:HTTPS} !on
# RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} index\.php
RewriteRule ^(.*)index\.php$ /$1/ [R=301,L]
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
# browser requests PHP
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]
# check to see if the request is for a PHP file:
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^/?(.*)$ /$1.php [L]
RewriteRule ^coin/(.+)$ /index.php?coin=$1 [L]
Answer the question
In order to leave comments, you need to log in
GET is not part of the url, so it stands out separately.
# 301 --- http://www.mydefile.ru/lookbook/?type=Рекламные+кампании&PAGEN_1=2 => http://www.mydefile.ru/news/campaigns/
RewriteCond %{QUERY_STRING} (^|&)type=Рекламные\+кампании($|&)
RewriteCond %{QUERY_STRING} (^|&)PAGEN_1=2($|&)
RewriteRule ^lookbook/$ /news/campaigns/? [L,R=301]
RewriteCond %{QUERY_STRING} (^|&)(coin=Name)($|&)
RewriteRule ^.*$ %2? [L,R=301]
%2
is the clear group from RewriteCond - analogue of $2 if it was a wheel Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question