D
D
d88a2021-11-23 11:44:30
htaccess
d88a, 2021-11-23 11:44:30

Why doesn't 301 redirect work in .htaccess?

301 redirect not working in .htaccess.
You need to make an exception for one page without an ssl certificate. Redirect https page to http .

This code does not work, and does not redirect anywhere at all. What could be the reason? Are there other options?

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/9010-2/veb-kamery
RewriteRule (.*) https://site/9010-2/veb-kamery%{REQUEST_URI} [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-11-23
@d88a

Will I screen for you?

RewriteRule ^9010\-2/veb\-kamery$ /9010\-2/veb\-kamery/9010\-2/veb\-kamery? [L,R=301]

So purely according to TK
And so if you want to somehow change some of the URLs on the site 1 rule
RewriteCond %{REQUEST_URI} ^/dir1/(.*)$ 
RewriteRule ^(.*)$ /dir2/%1 [R=301,L]

Where %1 is what is in RewriteCond in parentheses.
describe in more detail that you want one redirect or some condition per group of urls.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question