How do I redirect a page or folder?

I have removed a file from being on the website and would like to forward people who were looking for that file to another file. Is there an easy way to use redirect in the control panel? How can I use .htaccess to do this? Also, can I do it for an entire folder?

For cPanel, you can log into the control panel and on the main screen you will see an icon for Redirects.  From there you can select the file you want to redirect and then choose the destination.  The .htaccess file with the redirect commands will automatically be created for you.

What if I want to make the modifications in the .htaccess file myself?  How can I do that?

Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html

This is the base of the redirect command. You'll make a text file called ".htaccess" and upload that to your folder. Then just replace the old directory with your directory name etc.

How about if I want to redirect an entire folder?  Do I just do the same thing except replace the file with the folder name?

For redirecting a folder you can't do; Redirect /olddirectory http://yoursite.com/newdirectory/

You MUST have a file in the folder to redirect with;

Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html

  • 5 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

301 Redirect for All Domains

So you've purchased a ton of domains to park on your main account, but you don't want Google to...

301 Redirect from non-www to ww -- Without Looping!

So - you want to improve your search engine rankings, and SEO experts are telling you that Google...

Block a country using mod_geoip

Do you have a list of countries that you want to block access to your site?  Have you tried...

Hotlink protecting image.php and GD images

So you've enabled cpanel's hotlink protection, but those bandwidth theives are still attacking...

How to block an IP number

A user is accessing our website and we'd like to block this user as they continue to submit...

Powered by WHMCompleteSolution