I need to create a 301 redirect from file-1.html to file-2.html. It will be on windows hosting server. I have tried .htaccess and several other methods ,but none of them seem to be effective. What script should I use and where do I place the script?
A .htaccess file will only work if the HTTP server is Apache (and if it is configured to allow local overrides and if it has the mod_rewrite module loaded and enabled).
So if the server isn’t running Apache you’ll have to find how to do this with IIS or whatever is used instead. If it does run Apache but is not configured to allow this, you’re out of luck.
Permanent redirection 301 with .htaccess file requires that your website is hosted on an Apache (Linux, UNIX) based server. If you are not sure, a simple header check will show your server type. Header checker allows you to check the HTTP headers that the web server returns when requesting a URL.
-.htaccess does not work if you’re on a windows server
-Always be sure to upload .htaccess files in ascii mode, sending it up as binary will break it
-Make sure your ftp program will show .htaccess files
-Double check that you’re not overwriting an old one
You can use some free php/asp scripts to redirect your page. We are using some free javascripts as well to redirect some of our pages to another pages.
That however might have SEO related consequences (assuming file-1 was popular and getting lots of links to it). At least, that’s why I think so many are keen to do 301 redirects. From a visitor’s perspective, there’s little real difference.