WebFaction
Community site: login faq

I have a Django app that currently handles several different domains. One in particular is abc.com/blog/

The content there is mostly static so I moved it over to a WordPress site. That site is hosted on wordpress.abc.com and follows the same link structure except it doesn't append /blog/ to any links.

I would like to write a RewriteRule that takes all abc.com/blog/ links and rewrites them to the new wordpress.abc.com site EXCEPT one page at abc.com/blog/special/

Here's what I've tried in my httpd.conf file thus far but it doesn't appear to be doing anything.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.abc.com$[OR]
RewriteCond %{HTTP_HOST} ^abc.com$
RewriteRule /blog/ wordpress.abc.com$1 [P,L]

Any help is greatly appreciate. I'm very much a newbie when it comes to Apache settings.

asked 11 Jan, 19:20

aa56280
13414
accept rate: 0%

edited 11 Jan, 19:21


Place the rules within a Location directive. You can rewrite the last rule to something like this,

< Location /blog/>
RewriteEngine on
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc.com$ [NC]
RewriteCond %{HTTP_HOST} !abc.com/blog/special/$ [NC]
RewriteRule ^(.*)$ http://wordpress.abc.com/$1 [R=301,L]
<\Location>
permanent link

answered 11 Jan, 23:22

johns ♦♦
5.3k212
accept rate: 23%

Thanks. This doesn't seem to be doing anything either. I'm putting this at the bottom of my httpd.conf file. Is that where it's suppose to go?

(12 Jan, 17:11) aa56280

It is. We can troubleshoot directly if you send us a support ticket.

(12 Jan, 22:40) johns ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×904
×243
×224
×14

question asked: 11 Jan, 19:20

question was seen: 73 times

last updated: 12 Jan, 22:40

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM