0

I'm trying to point subdomain.example.com to a resource on subdomain2.example.com/?page_id=1

It's a wordpress blog. I'm attempting to give a static page its own subdomain. The point is to basically showcase the existing resource without giving away the URL... So far, I've tried...

RewriteCond %{REQUEST_URI} subdomain.example.com [NC]

RewriteRule ^(.*)$ http://subdomain2.example.com/?page_id=1 [P]

but to no avail.

Currently I have the subdomain.example.com set up as its own Virtual server with a RedirectPermanent to the resource. Anyone have any insight on how to achieve this? I think i'm getting closer but I'm very new to this. Thanks.

3 Answers3

1

Also see http://wiki.apache.org/httpd/WhenNotToUseRewrite

PP.
  • 3,316
  • 6
  • 27
  • 31
  • Thanks for posting this link, I found a few cases there I've been guilty of in the past. There are several recipes on this page which solve the problem more simply. `ProxyPass` would do this, nyet? – pjmorse Oct 19 '10 at 14:55
  • no, if I understand the problem correctly he always wants to redirect to the same static page, ProxyPass would always append anything after the given hostname to the end of the target and for that reason not always point to the same page. – Marcel G Oct 19 '10 at 22:10
0

Your issue might be the flags you're using. See the documentation for the available flags; my guess is that you want [L] instead of [P].

I don't think an entire virtual server is needed for this, but YMMV.

pjmorse
  • 1,550
  • 1
  • 17
  • 34
0

RewriteEngine On is there, just forgot to include it.

Adding [L] still just rewrites the url to subdomain2.example.com/?page_id=1 instead of what i want to appear in the browser as subdomain.example.com

I was thinking about mimicking the virtualserver for subdomain2.example.com and then forcing the subdomain.example.com to point to one url, and truncating everything after the .com ?

A huge waste of a virtual server, but...how would I go about that ordeal?