News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Redirecting from Root site - Go Daddy

Started by IamJaysta, March 04, 2012, 02:03:07 PM

Previous topic - Next topic

IamJaysta

Hello All,

GoDaddy lost all my files and had issues with  re-installing SMF.

I installed SMF in. www.mydomain.com/smf/ [nofollow]

GoDaddy will not allow me to redirect from the same domain, it will cause an error. They said that I can make  web.config file, but after googling it, it doesn't make any sense to me.

How can I create something in the root directory so when I type in www.mydomain.com [nofollow] it will redirect me to www.mydomain.com/smf [nofollow]  automatically??

Please help!! Thanks

mashby

rewriteengine on
rewritecond %{HTTP_HOST} ^www.mydomain.com$ [OR]
rewritecond %{HTTP_HOST} ^mydomain.com$
rewriterule ^$ "http\:\/\/mydomain\.com\/smf" [R=301,L]

Might be something like that.

Although if my host "lost" my files, I'd be looking for a new one, but that's just me. :)
Always be a little kinder than necessary.
- James M. Barrie

IamJaysta

I am newbie to this coding, where would I attached this coding to?

NanoSector

Quote from: IamJaysta on March 04, 2012, 02:52:10 PM
I am newbie to this coding, where would I attached this coding to?
Put that in a ".htaccess" file (without quotes) in the root of your site :)

If you're with GoDaddy though, first thing I did was run far away and take my backup with me :P
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

IamJaysta

yeah I did make a back up, those guys are idiots and I'm a beginner lol.

Let me get this striaght.  I would open a txt document.

Add the following:

rewriteengine on
rewritecond %{HTTP_HOST} ^www.mydomain.com$ [OR]
rewritecond %{HTTP_HOST} ^mydomain.com$
rewriterule ^$ "http\:\/\/mydomain\.com\/smf" [R=301,L]


Save it down as ".htaccess"

and just drop the file in the root folder?

mashby

Always be a little kinder than necessary.
- James M. Barrie

NanoSector

Quote from: IamJaysta on March 04, 2012, 03:05:57 PM
yeah I did make a back up, those guys are idiots and I'm a beginner lol.

Let me get this striaght.  I would open a txt document.

Add the following:

rewriteengine on
rewritecond %{HTTP_HOST} ^www.mydomain.com$ [OR]
rewritecond %{HTTP_HOST} ^mydomain.com$
rewriterule ^$ "http\:\/\/mydomain\.com\/smf" [R=301,L]


Save it down as ".htaccess"

and just drop the file in the root folder?
That's correct :)

(with root folder I mean the "public_html" folder or "www" folder or something like it)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

IamJaysta

Attached is the screen shot.

I did exactly what you guys requested me to do, but it's still not working

mashby

What permissions are set on .htaccess? Appears to be none. Might want to adjust that. :)
Always be a little kinder than necessary.
- James M. Barrie

IamJaysta


MrPhil

Are you on an Apache server, or IIS? If IIS (Microsoft), it will normally ignore .htaccess. You'll have to find some other way to redirect.

If your intent is to have visitors to [www.]yourdomain.com/ end up at www.yourdomain.com/smf (you did substitute your actual domain name, right?):
RewriteEngine On
RewriteCond  %{HTTP_HOST} ^(www\.)?yourdomain\.com
RewriteRule ^$ http://www.yourdomain.com/smf [R=301,L]

Only if no URI is given (other than a single /), the visitor is sent to /smf and it shows up in the address bar. Search engines will list the /smf version (as it's a "permanent" 301 redirect).

If you want just a silent rewrite to /smf, without the address bar showing it (or search engines indexing it that way):
RewriteEngine On
RewriteCond  %{HTTP_HOST} ^(www\.)?yourdomain\.com
RewriteRule ^$ /smf [L]

In both cases, the RewriteCond is probably unnecessary.

IamJaysta

This is a windows platform, where would i input this information?  Do I name it another file vs htacess

MrPhil

If this is an IIS server, ask GoDaddy if it's possible to install and use a URL rewrite module. I understand that there is one for IIS which gives you much of the function of an Apache server mod_rewrite, but I haven't used it myself, and don't know if it will read an .htaccess file (it may have to be named something else; it may have a different format; etc.).

IamJaysta

I need to create web.config file to redirect from my root folder which has nothing to mydomain.com/smf [nofollow].  I googled many things but when I execut it, I get random errros like redirect loop and 500 error and etc.  This should be simple, but I am getting very frustrated.

IamJaysta

I solved it,

just created  index.php file  with:

<script type="text/javascript" language="JavaScript">
window.location="http://www.domain.net/smf/"; [nofollow]
</script>

Bigguy

I will mark this solved for you then. The way you have it now should work fine. :)

Advertisement: