0

I host my wordpress on appfog but appfog doesn't allow wildcard subdomain yet. I decided to create an app on heroku and place the htaccess there, so any wildcard subdomain will rewrite to appfog.

How to make the URL sample-post.apps1.herokuapp.com/subtitle/... --> apps1.appfog.com/sample-post/subtitle/... using htaccess placed on heroku cedar?

1 Answers1

0

Try:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^.]+)\.apps1\.herokuapp\.com$ [NC]
RewriteRule ^(.*)$ http://apps1.appfog.com/%1/$1 [L,R]

If you don't want the URL in the browser's address bar to change (via the redirect, R flag in square brackets), then try changing the R to P (proxy). Apache would need to have mod_proxy loaded.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • yeah it's working but maybe wordpress doesn't recognise it. It stays at homepage for "sample-page.apps1.herokuapp.com" but when I write "sample-page.apps1.herokuapp.com/sample-page" or "apps1.herokuapp.com/sample-page", it going to sample-page's page. – user1385778 Nov 28 '12 at 07:22