301 Redirect from main page to folder

Started by Optimitron, Oct 24, 2022, 10:25 AM

Previous topic - Next topic

OptimitronTopic starter

Good day! Help to implement the 301 redirect.
I need the following:
with site.com we need to make a redirect to site.com/block

Tried it:

Redirect 301 / http://www.site.com/block # does not work
RewriteRule ^/index.php /block/$1 [L,R=301] # does not work

I get - "Cyclic redirection on the page"
Help me please. Thank you very much.


Try the following script in .htaccess

RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^site\.com$ [NC]
RewriteRule ^(.*)$ http://site.com/block/$1 [L,R=301]

And read the following link about 301 redirects:
https://linchpinseo.com/htaccess-rules/ [nofollow]