How do I redirect a page or folder? Print

  • 125

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


Was this answer helpful?

« Back