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 02-12-2012, 07:22 PM
Contributing Member
Latest Blog:
None

 
Join Date: 01-22-12
Posts: 110
iTrader: 0 / 0%
HTACCESS - Need help in Permanent Redirection Issue

hello gurus,

as part of my learning, i've encountered the subject htaccess.

there is one issue i wanted to ask and clear about, if it's possible to accomplish.

facts:

i have 2 separate domain on the same server.

-country based domain, http://national-site.ph
-regional based domain, http://regional-site.ph

i want to redirect my regional based domain name to a sub-domain of my country based domain.

it's like this,

http://regional-site.ph

shall be redirected to

http://regional-site.national-site.ph

and after redirection, the address bar in the browser shall display

http://regional-site.ph instead of

http://regional-site.national-site.ph

Last edited by HTMLBasicTutor; 02-12-2012 at 08:05 PM.
 
Reply With Quote
  #2 (permalink)  
Old 02-12-2012, 08:07 PM
HTMLBasicTutor's Avatar
Super Moderator
 
Join Date: 10-29-07
Location: British Columbia, Canada
Posts: 18,271
iTrader: 5 / 100%
Why do you want to do this?
__________________

HTML Basic Tutor - Learn how to code for better SEO
Basic Computer Information - Computer & internet basics for website owners

SEO troubleshooting and review services available. - Pm me.
 
Reply With Quote
  #3 (permalink)  
Old 02-13-2012, 02:05 AM
Contributing Member
Latest Blog:
None

 
Join Date: 01-22-12
Posts: 110
iTrader: 0 / 0%
let's just say, its a case scenario. a problem that need a soluton.

so, does this particular problem has a solution?

here are the facts of the problem:

- i've created a website named newyork-classifieds .com

- i've created another website namedusa-classifieds .com

- i want to merged the two website, but maintaining their install status.

- now, i want a regional based site for usa-classifieds.com, and i've created an empty sub-domain.

- both website have users and post listings.

- now, instead of creating a new site inside the sub domain of usa-classifieds.com,
i would want to just redirectnewyork-classifieds.com] to

newyork.usa-classifieds.com

THE purpose of the problem scenario is to simulate a real-life problem, where a classified ads website installation only supports categories but not region or areas.

i hope you got me right. im not a native english speaker. i've tried my best to explain the above.

Last edited by ScriptMan; 02-13-2012 at 05:02 AM. Reason: links
 
Reply With Quote
  #4 (permalink)  
Old 02-13-2012, 05:03 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,263
iTrader: 4 / 100%
Why in the world would you want to do something like that?

When all you have to do is include the page using frames or curl.

http://www.php.net/manual/en/curl.examples-basic.php
__________________
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
  #5 (permalink)  
Old 02-13-2012, 06:34 AM
Contributing Member
Latest Blog:
None

 
Join Date: 01-22-12
Posts: 110
iTrader: 0 / 0%
@ScriptMan

...how am i suppose to do that? may you give examples and tutorials?


it's a case scenerio. a problem to solve.

say for instance, "newyork-classifieds.com" already has traffic.

and i created another website which is a national based/country based website, "usa-classifieds.com"

now... this newly created national based website shall have a regional sub-domain site, that corresponds to all the usa states.

...but i already have one regional based website, which is, "newyork-classifieds.com".

the contents of "newyork-classifieds.com" shall be transferred to

newyork.usa-classifieds.com

since, newyork-classifieds.com already has traffic and popular, i need to preserve the domain name. but, it also needs redirection since, the contents will be transferred to
newyork.usa-classifieds.com

and user shall be redirected to newyork.usa-classifieds.com from newyork-classifieds.com. and the rule shall be, the address that shall appear in the address bar would be, newyork-classifieds.com

i hope you get what i mean. please ask me again if this explanation wasn't clear enough.
 
Reply With Quote
  #6 (permalink)  
Old 02-13-2012, 07:25 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,263
iTrader: 4 / 100%
I am moving some sites around today so I don't have time to write examples. But here is how it is done using iframes. lexkyweb.com/classifieds.php everything below that gray bar is a framed include from another site.

This is one of the sites I am shifting so it may or may not load two hours from the timestamp of this post.

That code I can share on my next visit after I get some work done.
__________________
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
  #7 (permalink)  
Old 02-13-2012, 07:32 AM
Contributing Member
Latest Blog:
None

 
Join Date: 01-22-12
Posts: 110
iTrader: 0 / 0%
@ScriptMan

SO, the only remedy for the case problem, is to use iframe? and an htaccess redirection, will bring no solution to the case problem?

if i use the iframe methond, what will be the effect when it comes to the subject of SEO?
 
Reply With Quote
  #8 (permalink)  
Old 02-14-2012, 05:47 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,263
iTrader: 4 / 100%
You are correct about frames. That is why I don't really care for them.

And after playing with curl I don't think it will do the job you want either. It will duplicate the content as text only.

I think your best option is probably to create an RSS feed for each category of the first site and then display that feed in the correct place of the new site. By doing it this way each link contained in that displayed feed would take the viewer to the first site.

RSS can display anything you care to include in the feed. Most sites limit what they put in the feed, but where you own both sites you can do as you please.

You could control whether that was in the same window or in a new one by how you structure the href.

Depending on the server config remote file include might be possible but it is unlikely that you will find that allowed on any shared hosting account and I'm not so sure it is safe, even on a vps or dedicated server.
__________________
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
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
htaccess and image dir redirection - Magento parrighi Coding Forum 1 06-02-2011 05:14 AM
htaccess redirection question jonnyfolk Coding Forum 2 09-28-2009 11:11 PM
Need help with .htaccess file (www. redirection) projectwealth Domain Name Forum 4 01-09-2008 05:32 AM


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


All times are GMT -7. The time now is 11:50 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.