Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 07-31-2012, 04:40 AM
Junior Member
 
Join Date: 07-31-12
Posts: 1
iTrader: 0 / 0%
Thumbs down 301 htacess redirect question

Hi all, my name is Christian.
Been struggling the past 2 months to get information out of various forums...so forgive me if a am a bit critical.

This is my problem and I am looking for advice...please?

My main domain is: gateway-africa.com
- This has a sub domain: safari.gateway-africa.com
- Had some duplicate content problems due to have the safari folder in the main domain.
- I am putting all the content of the safari folder in the sub domain (safari.gateway-africa) and then the safari folder would be empty. Is this the correct procedure, thingie to do?

Question:
- Where do I put a .htaccess file to 301 redirect the safari folder urls to the sub domain, In the safari folder of the main domain, or in the main domain itself?

- What is the correct code that go in a .htacces? Just "redirect 301 blah blah", or is there addtional code before this?

There quite a few questions I need to get info on, but later.

Thank you kindly for your help if you can.
 
Reply With Quote
  #2 (permalink)  
Old 07-31-2012, 05:28 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,103
iTrader: 4 / 100%
I moved your post to this section for a better chance at an answer. I know the simple stuff but this one might be over my head a bit. Give it a day or two for the correct answer to come along.

Welcome to the forums.
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
2013 resolution: Don't feed trolls
ScriptMan
 
Reply With Quote
  #3 (permalink)  
Old 08-02-2012, 02:42 AM
Member
Latest Blog:
None

 
Join Date: 07-29-12
Posts: 32
iTrader: 0 / 0%
Quote:
Originally Posted by christianfourie View Post
Question:
- Where do I put a .htaccess file to 301 redirect the safari folder urls to the sub domain, In the safari folder of the main domain, or in the main domain itself?

- What is the correct code that go in a .htacces? Just "redirect 301 blah blah", or is there addtional code before this?
I think it would be best to put it in the root directory of the main domain. You can see this for more comprehensive information:

http://codegrad.hub.ph/using-htacces...in-subfolders/

However, it used to be that Google viewed subdomains as separate websites, meaning that if you have a link to a subdomain your main domain wouldn't get credit. That seems to have changed last year. I don't know what other search engines are doing.

http://www.seroundtable.com/subdomai...ols-13960.html

I don't see any benefit to using a subdomain in this case at all.
 
Reply With Quote
  #4 (permalink)  
Old 08-03-2012, 08:23 PM
Muddy's Avatar
Super Moderator
Latest Blog:
None

 
Join Date: 12-03-08
Location: Florida
Posts: 14,018
iTrader: 0 / 0%
I was just going to post a similar question. I'm wondering how to prevent an .htaccess file located in the root from redirecting sub-directories.
__________________
More products than you can shake a stir stick at! Paint supplies and sundries.

 
Reply With Quote
  #5 (permalink)  
Old 08-03-2012, 09:29 PM
The Controversial Coder
Latest Blog:
None

 
Join Date: 05-01-06
Location: Manchester; UK
Posts: 2,374
iTrader: 0 / 0%
Quote:
Originally Posted by Muddy View Post
I was just going to post a similar question. I'm wondering how to prevent an .htaccess file located in the root from redirecting sub-directories.
I'm not sure, it's been a long time since I looked at anything to do with this, but I am pretty sure unless it's advanced any you would have to look into mod_rewrite.
 
Reply With Quote
  #6 (permalink)  
Old 08-03-2012, 10:44 PM
Muddy's Avatar
Super Moderator
Latest Blog:
None

 
Join Date: 12-03-08
Location: Florida
Posts: 14,018
iTrader: 0 / 0%
Thanks Dan! It was as simple as this:

RewriteEngine on
RewriteRule ^$ http://www.example.com/ [R=301,L]
__________________
More products than you can shake a stir stick at! Paint supplies and sundries.

 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to write a .htacess 302 redirect for specific pages datrader Coding Forum 3 10-08-2011 07:09 AM
Question about URL Redirect Manikkavalli SEO Forum 5 02-20-2010 11:22 PM
Question about htacess Brave7 Coding Forum 6 09-12-2009 06:26 PM
Redirect 301 Question FGTH Coding Forum 3 07-02-2005 07:01 PM
Redirect Question crazyhorse Google Forum 7 12-04-2004 05:12 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:16 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.