301 Redirect Error
Hello, I have an issue when I create a redirect using cPanel, gives me an error:
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I made some research, and I try to made manually on .htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com.br$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.com.br$
RewriteRule ^.?$ to
-
I can't tell you what your error is, but I would not suggest forcing https redirect with the cPanel redirects. You'll end up with a loop if someone is already accessing it via https. We suggest code like this: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]0 -
ffeingol as you instrutions: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ www.example.com.br it opens normal and redirect to UptimeRobot | Free Website Monitoring) to monitor the HTTP service, and when I always add the code to redirect using .htaccess the uptime robot says http is down. 0 -
Are you 100% sure that both example.com.br and www.example.com.br both resolve your your server (i.e. no DNS issue)? Is there anything else in the .htaccess file other than this code? 0 -
Hello, I have checked on: intoDNS: checks DNS and mail servers health and there is no error on DNS entries. my .htaccess: RewriteOptions inherit # php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php72" package as the default "PHP" programming language. AddHandler application/x-httpd-ea-php72 .php .php7 .phtml # php -- END cPanel-generated handler, do not edit RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ My Title | Example ... 0 -
Are you using software like WordPress or something similar? If so, I have found that a plugin that handles https redirection works better than trying to use .htaccess. 0 -
Yes, it is WordPress. 0
Please sign in to leave a comment.
Comments
7 comments