301 Redirect from main webpage to folder

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

Previous topic - Next topic

OptimitronTopic starter

Hello! I require assistance with implementing a 301 redirect. Specifically, I need to redirect site.com to site.com/block.

I have attempted the following methods:

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

However, I am encountering an error message stating "Cyclic redirection on the page". Could you kindly provide me with some guidance on how to resolve this issue? Thank you in advance for your help.
  •  

Pournima

To implement the desired 301 redirect, you can try out the following script in your .htaccess file:

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

Additionally, you may find this link on 301 redirects helpful:
https://linchpinseo.com/htaccess-rules/
  •