LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-19-2011, 02:58 PM   #1
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 387

Rep: Reputation: 61
Smile Wordpress URL annoyance - Apache rewrite engine?


Hi,

I've a blog hosted with DynDNS from my home, so my presence on the web is via a static host name, not a dynamic IP address assigned by my ISP. Dandy. Let's say it's "http://beaver1.homeserver.org/blog/"

I bought a domain name from FastHosts where they can redirect to a given URL such as the above. So say the domain I bought was "theblog.org". This is fine, but when you enter the site, the internal links are the DynDNS address.

The URL bar is fine if you go to "http://theblog.org", but all the "internal" post links point to "http://beaver1.homeserver.org/blog/p?=4432" or whatever the post is. I know there are two settings in Wordpress, the site address URL and the Wordpress address URL. Changing one or the other to "http://theblog.org" doesn't seem to work.

Could I use Apache's rewrite engine to change "http://beaver1.homeserver.org/blog/p?=3343" to "http://theblog.org/p?=3343" for example or what? Any help appreciated. How do the pros do it?

I'm really not sure if this is a Wordpress thing or something else. If something else, could I use the rewrite engine to fix it?

Last edited by arashi256; 10-19-2011 at 03:01 PM.
 
Old 10-19-2011, 03:10 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
you can't (well... shouldn't) try to change the html code being returned by wordpress. sounds like a nice idea, but it always goes bad in the end.

when you say this other domain redirects, what do you mean? what actual operation happens? and http redirect, or this actually a purely dns based solution and no such operation occurs.

For wordpress you'd basically just want to change the blog address to the "nice" domain name, possible leaving the site url as the real address if you wish (that address is used for css, images, admin etc... not the actual posts.)
 
Old 10-20-2011, 05:18 AM   #3
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 387

Original Poster
Rep: Reputation: 61
The FastHosts forwards the request from "http://theblog.org" to "http://beaver1.homeserver.org/blog/" but the fowarding is set to "Masked", so only the "http://theblog.org" URL appears in the browser address bar. The other types of redirection where HTTP 301 or 302, which didn't seem right.

What I want is instead of "http://theblog.org" appearing in the address bar, no matter which page you're on (because of the mask) and the *internal* Wordpress site links looking like: -

"http://beaver1.homeserver.org/blog/?p=3343", I'd like everything to look like: -

"http://theblog.org/?p=3343", both internally on Wordpress links and in my address bar. If I set the Wordpress site address URL to "http://theblog.org", it breaks a lot of the theme's CSS stylesheets and I cannot get to wp-admin any more.

So, forwarding problem, DynDNS problem, Wordpress problem or rewrite engine-needed solution or something else?
 
Old 10-20-2011, 05:47 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
ok so this forwarding is just a crappy iframe? if you view the source of that page, you just see an iframe pointing to the real address? sounds like that's what it is, and that sucks.

surely all you actually want is, assuming that there's no even better way here, to just set the "nice" name to be a DNS CNAME to the dynamic host name. That should sort out everything just fine, if you can do it. depends on what this service you've purchased really provides though.
 
Old 10-20-2011, 05:53 AM   #5
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 387

Original Poster
Rep: Reputation: 61
I can get to the CNAME records for my hosting, but the "points to" entry can only contain an IP address, not "http://beaver1.homeserver.org". I assume none of this would be a problem if I had a static IP address rather than a DynDNS hostname that is updated with my ISP-assigned dynamic IP address.

The CNAME entry has [textbox].theblog.org with the ".theblog.org" being something you cannot change.

Last edited by arashi256; 10-20-2011 at 05:58 AM.
 
Old 10-21-2011, 03:34 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,597

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Buy a $4 a month hosting account and host your blog "outside", or use your new domain name with DynDNS and point it to your home machine as well. Just because it's registered with FastHosts doesn't mean you have to use them for your DNS providers.
 
  


Reply

Tags
apache, rewrite, url, wordpress


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 1.3 mod_rewrite - how to rewrite url with port dlugasx Linux - Server 1 05-19-2009 11:34 AM
Apache: rewrite engine and regular expressions romulas Linux - Server 2 03-27-2009 12:00 PM
apache url rewrite about Canonical URLs addbbe Linux - Server 9 02-12-2009 06:21 AM
Rewrite engine for apache wanna13e Linux - Software 2 09-11-2007 09:08 PM
apache url rewrite gallew Linux - Server 0 08-25-2006 04:54 AM


All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration