C
C
cherezov_d2017-08-27 01:10:53
htaccess
cherezov_d, 2017-08-27 01:10:53

Need help with htacess. How to make a redirect correctly?

It is necessary to redirect from domain to domain and from domain to subdomain, how to do it correctly?
Here htacess gives out when redirecting - too many redirects, when redirecting to a subdomain, how to avoid?
- what htacess looks like-
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{REQUEST_URI} ! \?
RewriteCond %{REQUEST_URI} !\&
RewriteCond %{REQUEST_URI} !\=
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !\/$
RewriteRule ^(.*[^\/])$ /$1/ [R=301,L]
Redirect 301 /uslugi/studiya-krasotyi/kosmetologiyaeverest-kursy.ru/uslugi/kursyi-kosmetologa
Redirect 301 /uslugi/kompyuternye-kursy/elektronnyie-tablitsyi-excel kazan.everest-kursy.ru/uslugi/kompyuternye-kursy/e...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-08-31
@shambler81

some kind of garbage dump and not redirects
a bunch of very strange conditions
, in addition, after the CNC
And that
If the url does not contain a get request
and does not contain a second get request, moreover, how will it appear if not 1
And if not =
And if it does not contain dots ( that is, all files)
And this is not the main one, moreover, with a slash, without a slash does not count
Then redirect everything up to the first slash to this
Write what exactly you would like to do
Preferably a couple of urls what should go where.
I will write the regular

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question