Answer the question
In order to leave comments, you need to log in
How to defeat a circular redirect (htaccess)?
Good afternoon! Prompt with .htaccess and 301 redirect.
There is a page https://my.site/flowers.php I want to change the url to https://my.site/my-flowers
I write in htaccess:
RewriteRule ^my-flowers$ https://my.site/flowers.php [L]
And everything works well.
But I remember that now I need to put a 301 redirect from the past to the new URL!
And I add to htaccess:
RewriteRule ^flowers.php https://my.site/my-flowers [R=301,L]
After that, I get a cyclic redirect. And nothing works. And nothing helps
Answer the question
In order to leave comments, you need to log in
RewriteCond %{THE_REQUEST} ^\S+\s/flowers\.php
RewriteRule ^ https://my.site/my-flowers [R=301,L]
RewriteRule ^my-flowers$ /flowers.php [L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^flowers\.php https://my.site/my-flowers [R=301,L]
RewriteRule ^my-flowers$ /flowers.php [L]
Chrome -> RMB on the element -> View element code -> the developer panel will open and all the styles applied to the element will be shown. Find one that overlaps with your style.
As geek01 wrote above , put !important, or check if it is already on the main class by default, if so, then it's better to find out why, if just like that, then it's better to remove it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question