4 Ways to redirect your websites
Jul15Difficulty: 




4 Ways to redirect your website to another page or path.
For this example I will use the website: http://www.domain.com
Let’s say this site is build in the folder: /folder/ we need a redirect from
DOMAIN to DOMAIN/FOLDER. I will show you the ways how to do it. You can re-use my code, just use your own domain and folder paths!
The easiest way:
Create in the root of your domain an index.html and use a meta-refresh tag in the
This way of redirecting is according to W3C not so nice, and it also will have a delay.
You can set this delay, however I set it to 0.
<meta http-equiv="refresh" content="0;URL=http://www.domain.com/folder/" />
The accessible way:
Not so nice, but to most accessible way, is to just create an empty index.html with an hyperlink
to your new folder.
Oops, the page you are looking for, does not exist anymore. <a href="http://www.domain.com/folder">Browse to the correct page by following this link</a>.
The Javascript way:
A good way to use. However if Javascript is disabled in your browser your stuck on the page where this
Javascript code is placed. (index.html in the root of your domain)
<script type="text/javascript"> /*<![CDATA[*/ window.location="http://www.sandranasicfans.eu/sandranasic/"; /*]]>*/ </script>
The server way:
This will work on Apache linux servers only.
Create with notepad a file called: .htaccess with the below content. Place this file in root of your domain.
Please note that on some servers you can not see this file with your FTP client. I found out that most of the time the webvariant of your hosted server (file manager), will show them.
However, I think this is the best and fastest way of redirecting.
RewriteEngine on rewriterule ^(.*)$ http://www.domain.com/folder/$1 [r=301,nc]
Posted in browsers, html, javascript, tools |.htaccess, / accessibility, / javascript redirect, / meta redirect, / redirect, / redirecting
» Post your comment, there are no comments yet. »














Comments