We help IT Professionals succeed at work.

help with 301 redirect

elliottbenzle
elliottbenzle used Ask the Experts™
on
I am trying to redirect my old site to my new site. I've added a .htaccess file but nothing seems to be happening.

My .htaccess file is here: http://mainstpackaging.com/.htaccess

I want to redirect from    http://mainstpackaging.com/      to     http://mainst-group.com/

any ideas what I'm doing wrong?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try this . Its a simple javascript redirect

on your old site rename the index file and create a index.html

add this to the new index.html
<html>
<HEAD>
<SCRIPT language="JavaScript">
<!--
window.location="http://mainst-group.com/";
//-->
</SCRIPT>
</HEAD>
<body>
</body>
</html>

see more at the url below

http://www.pageresource.com/jscript/jredir.htm
Jason C. LevineDon't talk to me.
Commented:
>> access file is here: http://mainstpackaging.com/.htaccess

You may not have the .htaccess set up correctly.  I shouldn't be able to see it from a browser.  If I can, it may mean that the server is treating it as content instead of following the instructions in the file.
true ensure that you have a propper file extension on your file . are you sure you server supports htaccess files?
LinuxGuruLinux Server Administrator
Commented:
Hi,

There seems to some problem with your webserver. Make sure that your webserver support .htaccess. Also I can view .htaccess file in browser http://mainstpackaging.com/.htaccess . The server does not seem to be accepting the .htaccess rules. (Normally its not possible to access .htaccess files through browser)

You can refer the code mentioned in the following question for 301 redirect.

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Q_25072803.html

Author

Commented:
Thanks, everyone was right. It seemed to be a problem with .htaccess.