How Do I Redirect This URL?

by 4 replies
5
Hey guys,

My site was hacked a few months ago and although I've cleaned up my site, I need to perform a redirect.

How do I redirect Best Way to Get Ripped Fast to https://thescienceofgettingripped.com/manual

It looks like all of the pages on my site besides that one are redirecting properly.

I've tried a 301 re-direct in CPanel but it says that it will create an infinite loop.

Thanks
#programming #redirect #url
  • Have you tried skipping cPanel and modifying .htaccess directly via FTP? Instructions here: htaccess Redirect
  • Try to take back up of original ht-access file before editing and use the following code for redirection.

    RewriteCond %{HTTPS} off
    # First rewrite to HTTPS:
    # Don't put www. here. If it is already there it will be included, if not
    # the subsequent rule will catch it.
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Now, rewrite any request to the wrong domain to use www.
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • This is how I did it in .htaccess, so your whole site is redirected to https
  • Select URL Redirect Record from the drop-down menu for Type, put @ (your bare domain e.g. yourdomain.tld) for Host and enter a URL you would like to redirect a domain to into the Value line: 4. Click on Save all changes button.

Next Topics on Trending Feed