How do you redirect your website using a .htaccess file?
How to set the default page for your website? How to create a .htaccess file to redirect your website or site content to the specific URL. It does not redirect your email or any other function for your domain or website. The .htaccess file is very power full and after editing it you can redirect your website of any file content to specific URL. If you are using the cPanel as hosting panel Then please follow the below Steps. Step1. Please login to the cPanel Step2. Select the file manager and click on it Step3. After one small popwindow will open and there is check box with massage Show Hidden File And Folder Step4. Please click on check Box. Step5. After opening the File Manage Click on the public_html folder Step6. Select the .htaccess file and click for opening in Code Editor And then Edit as per your requirement 1. Redirect your website to any another URL Redirect 301 / http://yourDomainName.com/ 2. Redirect your default page at specific Folder or subfolder Redirect /index.html http://YourDomainName.com/newdirectory/ Or SubFolder Redirect /index.html http://YourDomainName.com/newdirectory/Subfolder 3. Redirect an old file to a new file path Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html 4. Redirect to a specific index page: Set as a default or landing page for your website DirectoryIndex index.html Please note : Some time you did not make the file as .htaccess So please make as htaccess.txt or with another file extension and Upload at the server and then rename it as .htaccess