By Richard | January 23, 2012 at 2:24 pm | No comments | Domaining, Tutorials | Tags: Apache, browser, call, Change, code, com, config, domain, domain name, Enjoy, file, htaccess file, index, name, page, search, search engine, server, test, text, txt, Upload, web server, website, www
This code will only affect users trying to hit your website at “/” or “/index.html”. If a user attempts to find a page called “/test” their browser will return a 404. This .htaccess file is very useful for search engine bots to know this domain forwards to another as quick as possible without violating any terms of service.
To start, create a text file, call it “htaccess.txt”.
- Add the following code from below
- Change the domain name to the domain you want it to redirect to
- Upload your file to your web server
- Depending on your apache config, Change the filename from “htaccess.txt” to “.htaccess”
- Enjoy your new direct
# Redirect
Redirect 301 /index.html http://www.yourdomainhere.com