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

  • 93 Users Found This Useful
Was this answer helpful?

Related Articles

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

So - you want to improve your search engine rankings, and SEO gurus told you that Google might be...

Add IonCube to a custom php.ini (PHP 5.3+)

IonCube is installed by default on the servers, however if you require adding custom settings...

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 adding...

Force folder to redirect to https mode

Sometimes webmasters need to force particular folders to load in HTTPS mode. This is ideal for...

Hotlink protecting image.php and GD images

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

Powered by WHMCompleteSolution