MU Advanced: Issues and Discussion
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • July 31, 2010, 05:56:11 PM
Home Forums Contact Tags FAQ Links News Login Register
* *
Navigation Menu
Search

Random Quotes
To succeed in politics, it is often necessary to rise above your principles.
- Murphy's Law
Pages: [1]   Go Down
  Print  
Author Topic: 301 redirects and moved subdomains  (Read 4578 times)
0 Members and 1 Guest are viewing this topic.
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« on: March 31, 2008, 07:32:07 AM »

Allrighty tech-heads got a question for ya.

I have a member blog that has "graduated" and moved off to her own domain. i would like to redirect her old blog address to her new domain. (also? She paid me.)

Mr google helped plenty except for the fact what I typed in did not work. Cheesy naturally, there was not a specific example of what I wanted to do and I'm not sure how to handle the whole virtual subdomain and a 301 redirect.

redirect 301 sublog.hsj.net to http://hernewdomain.com was a no-go. It's at the bottom of the file, if that helps.
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #1 on: March 31, 2008, 09:06:52 AM »

A quick google tells me that this is what's needed:

Code:
RewriteCond %{HTTP_HOST} ^username\.hsj\.net
RewriteRule (.*) http://hernewdomain.com/$1 [R=301,L]

Damn if I know though.

For reference, I got it from here.

I see mention of doing it as a server alias which would probably be best.  That way, it's done at the apache level and doesn't fill up your htaccess file.
Logged

Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #2 on: March 31, 2008, 09:25:57 AM »

Ahhh your google-fu is exceeding mine today.  Smiley thanks.

Forgot to mention new domain is on another server (ie; not mine). wasn't ready to host her yet.

Edit: those htaccess lines worked like a charm.

i didn;t mind it int he htacces because it;s 2 lines. I doubt I'd have ten people doing this. and if I do get to that spot, I'll host 'em and do it the other way. :d
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #3 on: March 31, 2008, 09:41:40 AM »

Not a problem.
Logged

trent
Jr. Member
**

Karma: 0
Offline Offline

Posts: 82



View Profile WWW
« Reply #4 on: March 31, 2008, 11:02:59 AM »

The only other thing you could do is create a premium plugin that redirects to whatever address the user wants.    I am not sure if a javascript solution would work or a simple redirect subscribing to the the wordpress header function would be enough, but then the user could put in the address through an option in their dashboard and redirect their blog wherever they want.   Might be something for the future versus constantly using .htaccess to do it.   I know I am going to run into this myself since I also have a few extra lines in the .htaccess now that I wouldn't mind getting rid of Wink

Trent
Logged
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #5 on: March 31, 2008, 11:13:31 AM »

Yeah, I'm totally putting on the "whenever" list for a future premium feature.

But my heavy coder still has his day job. Wink
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #6 on: March 31, 2008, 11:23:08 AM »

* Luke  prefers to let php handle it, so htaccess remains small.

An if check in the main index.php file, before it calls blog header.

If it's only a blog or two, htaccess is OK, but more than that is really not worth it.
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #7 on: March 31, 2008, 12:47:44 PM »

Could also just use a special theme assigned to only the old site where the index.php grabs the url that's being called, replaces the root of the address with the new site and does a 0 second refresh and sends the visitor on their way.

Nothing gets placed in the server or htaccess.  You do have another theme though to keep track of.  That's what some of our installs do although they do it quietly.  Offer it publicly and you wind up with hundreds of special themes when everybody want to do this.

Hmm, I wonder if this is how wp.com does it with their sunrise file that Donncha has hinted about.
Logged

Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #8 on: March 31, 2008, 01:42:06 PM »

But, why go through loading WP just to redirect?

Doesn't make resource sense.

Load a theme just to redirect? Nah.

Now, sunrise capabilities are another thing. For a large amount of such rewrites, it would make sense. As for how Donncha has it worked out, I've got a pretty good idea about it.
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #9 on: March 31, 2008, 01:47:29 PM »

Gonna tell us? :Dthe sunrise file ultimately sounds like a decent solution.  And yeah - so far this is *one* blog. I have a mountain of work to do before I even think about making it a publicly announced paid feature.

Edit: permalinks for the blog don't redirect. hmmm. hafta think about that. (whether I even want to, you know?)
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
trent
Jr. Member
**

Karma: 0
Offline Offline

Posts: 82



View Profile WWW
« Reply #10 on: March 31, 2008, 02:32:39 PM »

The following does redirects for me Wink

Code:
RewriteCond %{HTTP_HOST} ^blog.yourdomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]

Trent
Logged
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #11 on: March 31, 2008, 07:40:49 PM »

I hate rewrite rules.
Logged

ron_r
Key Master
*****

Karma: 4
Offline Offline

Posts: 1143



View Profile WWW
« Reply #12 on: March 31, 2008, 07:45:23 PM »

The only other thing you could do is create a premium plugin that redirects to whatever address the user wants.    <snip>   but then the user could put in the address through an option in their dashboard and redirect their blog wherever they want.   

I won't be writing something which will permit the user to do this themselves. Barring rare exceptions, this is something that would only be done once for each user. Between education time and errors, we would end up spending more time enabling the user to do it than we would doing it ourselves.
Logged

The key to problem solving is identifying the problem.
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #13 on: March 31, 2008, 08:10:55 PM »

Who is this "Ron" character?

Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #14 on: April 01, 2008, 08:42:07 AM »

seems familiar...
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
trent
Jr. Member
**

Karma: 0
Offline Offline

Posts: 82



View Profile WWW
« Reply #15 on: April 01, 2008, 09:21:56 AM »

I would have it close to the top of the .htaccess file as it only works for me that way.    If it is below the WPMU stuff it seems to not work.   It is at the top of mine.

Trent
Logged
ron_r
Key Master
*****

Karma: 4
Offline Offline

Posts: 1143



View Profile WWW
« Reply #16 on: April 03, 2008, 08:13:17 PM »

Who is this "Ron" character?



*Delurking* Cheesy
Logged

The key to problem solving is identifying the problem.
freshestnoob
Newbie
*

Karma: 0
Offline Offline

Posts: 7


View Profile
« Reply #17 on: May 01, 2008, 02:47:25 AM »

@Luke.
You've spent months staring at that ron's profile picture and you still can't figure who he is? Smiley

I spent five minutes here and I realised he is andrea's 'heavy coder' and lots more (who do you think he's kissing?).

I wish xer could see his profile picture. Smiley
Logged
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #18 on: May 01, 2008, 07:44:50 AM »

lol

Ron posts sporadically here, luke was giving him a hard time. Cheesy Yep, he;s my heavy coder and more for almost 20 years.

And yeah... lol at that other thread...
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
ron_r
Key Master
*****

Karma: 4
Offline Offline

Posts: 1143



View Profile WWW
« Reply #19 on: May 01, 2008, 08:44:44 PM »

Which thread was that?

(another occasional post) Cheesy
Logged

The key to problem solving is identifying the problem.
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #20 on: May 02, 2008, 07:45:49 AM »

It was that one on the other forum, honey - the where I said some guy didn't know I was a woman.  Shocked

@fresestnoob - it was funnier a few days ago when Ron & I still had the same avatar.
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #21 on: May 02, 2008, 09:05:24 AM »

We need to make Ron a big, manly avatar.

Something with guns, explosions, hunting, fishing, or sports. You know, grown-ass man stuff. Cheesy

Either that or we might have to color his username pink. Wink
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #22 on: May 02, 2008, 09:34:52 AM »

Who is this "Ron" character?

Didn't he have a girlfriend by the name of Kim....

As to the manly stuff line: Link

Don't know if our companions to the north can see that but....
Logged

Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #23 on: May 02, 2008, 11:47:18 AM »

We need to make Ron a big, manly avatar.

Something with guns, explosions, hunting, fishing, or sports. You know, grown-ass man stuff. Cheesy

Either that or we might have to color his username pink. Wink

*SIGHS*

FINE THEN. I shall make him a new one with his shiny tractor AND his chain saw. running.

tough enough for ya?  Tongue

(so much for geek love...  Cry )
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #24 on: May 02, 2008, 12:41:37 PM »

I dunno. Throw in some guns a blazing, and it might get close.

I got one sitting around that I could give him. Something about supporting single moms. he he he

Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
ron_r
Key Master
*****

Karma: 4
Offline Offline

Posts: 1143



View Profile WWW
« Reply #25 on: May 02, 2008, 07:52:44 PM »

I dunno. Throw in some guns a blazing, and it might get close.

I got one sitting around that I could give him. Something about supporting single moms. he he he



Do remember I live with 4 women, 3 of which are single and dependent. That's more than enough to support Cheesy

New icon should arrive tomorrow Smiley
Logged

The key to problem solving is identifying the problem.
ron_r
Key Master
*****

Karma: 4
Offline Offline

Posts: 1143



View Profile WWW
« Reply #26 on: May 04, 2008, 12:12:28 PM »

New icon should arrive tomorrow Smiley

Done Cheesy
Logged

The key to problem solving is identifying the problem.
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #27 on: May 04, 2008, 12:28:24 PM »

Where's the beer, gun, explosions, and funny furry hat with the ear flaps? Cheesy
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #28 on: May 04, 2008, 03:08:41 PM »

well he has a hat at least ...  Cheesy
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #29 on: May 04, 2008, 03:49:00 PM »

He does?  I can't see it in that picture.

My eyesight can't be that bad.
Logged

Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #30 on: May 05, 2008, 07:41:50 AM »

It's a black touque.  Cheesy

Aw heck, I can't remember what americans call 'em... you know, the knitted round hats you pull on.
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #31 on: May 05, 2008, 09:11:47 AM »

heh heh heh: http://en.wikipedia.org/wiki/Hat

They call them Toboccans down here in the Southern US.  I never called them that up north.
Logged

ron_r
Key Master
*****

Karma: 4
Offline Offline

Posts: 1143



View Profile WWW
« Reply #32 on: May 05, 2008, 07:01:23 PM »

Snow blindness Wink
Logged

The key to problem solving is identifying the problem.
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #33 on: May 05, 2008, 07:40:18 PM »

In cats?

Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #34 on: May 05, 2008, 08:30:44 PM »

i think we have seriously derailed this thread.  Cheesy Grin
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
Luke
Key Master
*****

Karma: 5
Offline Offline

Posts: 3710



View Profile WWW
« Reply #35 on: May 05, 2008, 10:29:10 PM »

Yep, I went there.
Logged

10 frames?
Heh, that's for Quakers.

Note: This message may be Canadian friendly.

"Pornographic monster on the floor"
drmike
Gate Keeper
*****

Karma: 3
Offline Offline

Posts: 2228



View Profile WWW
« Reply #36 on: May 05, 2008, 11:00:15 PM »

i think we have seriously derailed this thread.  Cheesy Grin

Did you ever get your issue dealt with?
Logged

trent
Jr. Member
**

Karma: 0
Offline Offline

Posts: 82



View Profile WWW
« Reply #37 on: May 05, 2008, 11:01:55 PM »

Andrea that is Canada.   It is a toque Smiley
Logged
Andrea_R
Key Master
*****

Karma: 5
Offline Offline

Posts: 1626


The spiky-haired mistress of homeschooling. (R)


View Profile WWW
« Reply #38 on: May 06, 2008, 07:06:18 AM »

i think we have seriously derailed this thread.  Cheesy Grin

Did you ever get your issue dealt with?

yep, the first day.  Grin
Logged

Am I the only one with a sig?
Ah well, might as well read my blog for lols.
Tags:

Pages: [1]   Go Up
  Print  
 
Jump to:  


Login
 
 
Recent Posts
Recent Topics
No new topics.
Hot Tags
Whos Online
8 Guests, 0 Users
Home Forums Contact Tags FAQ Links News Login Register