onlyme Posted May 7, 2011 Share Posted May 7, 2011 Hi, I am trying to redirect a non www address to a www address, but my code is not working. This is what I have: Redirect 301 http://website.com http://www.website.com Any ideas what I have wrong? Quote Link to comment https://forums.phpfreaks.com/topic/235791-301-redirect-not-working/ Share on other sites More sharing options...
sunfighter Posted May 8, 2011 Share Posted May 8, 2011 Any ideas what I have wrong? If you don't tell us your server or publish the code we have to get out the ouija board and mines broke. Quote Link to comment https://forums.phpfreaks.com/topic/235791-301-redirect-not-working/#findComment-1212506 Share on other sites More sharing options...
floridaflatlander Posted May 9, 2011 Share Posted May 9, 2011 Do have your htaccess in the right directory ? Quote Link to comment https://forums.phpfreaks.com/topic/235791-301-redirect-not-working/#findComment-1212574 Share on other sites More sharing options...
cyberRobot Posted May 10, 2011 Share Posted May 10, 2011 The redirect 301 needs to be formatted like: redirect 301 /old/old.php http://www.new.com/new.php So changing your redirect to the following should work: redirect 301 / http://www.website.com/ As long as your server supports .htaccess files and it's uploaded to the proper folder. Quote Link to comment https://forums.phpfreaks.com/topic/235791-301-redirect-not-working/#findComment-1213308 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.