Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Install and Upgrade Help => Aiheen aloitti: Mike72 - maaliskuu 01, 2011, 07:19:17 IP

Otsikko: 301 redirect script using an htaccess file ???
Kirjoitti: Mike72 - maaliskuu 01, 2011, 07:19:17 IP
Hi Guys,

I got my domain name yesterday and the forum works great. The only way I can get to it is by mydomainhere.com/simplemachinesforum/index.php

The domain name mydomainhere.com says Future home of something cool and don't redirect it. My hosting is at godaddy and they told me the following.

You cannot forward the domain to itself. You may want to consider a 301 redirect script using an Htaccess file.


I am lost on that. I have no problems with trying something out but I need some help on how.

Thank you
Otsikko: Re: 301 redirect script using an htaccess file ???
Kirjoitti: Oldiesmann - maaliskuu 02, 2011, 05:18:32 IP
So you just want to redirect mydomain.com to mydomain.com/simplemachinesforum/index.php?

That's quite easy to do.

Delete the index.html file in the root directory and replace it with an index.php file containing the following:

<?php
header
('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.mydomainhere.com/simplemachinesforum');
?>


If you don't plan on putting anything else at that domain, you can also move the forum.
Otsikko: Re: 301 redirect script using an htaccess file ???
Kirjoitti: Mike72 - maaliskuu 03, 2011, 05:52:10 IP
Lainaus käyttäjältä: Oldiesmann - maaliskuu 02, 2011, 05:18:32 IP
So you just want to redirect mydomain.com to mydomain.com/simplemachinesforum/index.php?

That's quite easy to do.

Delete the index.html file in the root directory and replace it with an index.php file containing the following:

<?php
header
('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.mydomainhere.com/simplemachinesforum');
?>


If you don't plan on putting anything else at that domain, you can also move the forum.

Thank you so much. That solved my problem.