L
L
LIAL2016-03-28 19:43:24
Apache HTTP Server
LIAL, 2016-03-28 19:43:24

How to make a redirect in htaccess (HTTPS enabled)?

Good afternoon, there is a site, it has the following lines in .htaccess

RewriteEngine On  
RewriteBase /     
                  
<IfModule mod_rewrite.c>
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


redirection of all requests from HTTP to HTTPS is also enabled at the web server level

. Task: to make a 301 redirect from mydomain.com/rules-23 to mydomain.com/rules

. I tried this: RewriteRule
^rules$ rules-23
in block) - does not work. I would be grateful if someone could tell me how to do it right and where to place this rule (higher or lower in the block)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2016-03-28
@shambler81

RewriteEngine On
RewriteBase /
Or

RewriteRule ^rules\-23$ https://site.ru/rules$  [NC,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question