Apache .htaccess redirect single page to heroku

seb

Using .htaccess, I'm trying to redirect a single page under a domain that I own to heroku.

I don't want users to see the heroku app url in the browser, so I'm trying this in my .htaccess file:

RewriteEngine on 
RewriteCond %{THE_REQUEST} ^mydomain.com/mypage
RewriteRule ^(.*) http://app-heroku.com [P]

This is based on what I've found here, the [P] being for proxy. Unfortunately this isn't working though. My knowledge about the Apache rewrite engine is quite limited. Any ideas?

Amit Verma

domain name is not part of match in %{THE_REQUEST} You need to use an additional RewriteCond to match the domain name

RewriteEngine on 
#if host ==domain.com
RewriteCond %{HTTP_HOST} ^domain\.com$
#and uri==/mypage
RewriteCond %{THE_REQUEST} /mypage
#redirect the request to http://app-heroku.com
RewriteRule ^(.*) http://app-heroku.com [P]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Redirect a single dynamic URL with Apache .htaccess to temporary page

From Dev

redirect htaccess single page with php parameters

From Dev

htaccess redirect all pages to a single page

From Dev

Wordpress, HTACCESS - redirect single page if iPhone or Safari

From Dev

how to redirect all URL's to Single page using .htaccess

From Dev

htaccess redirect subdirectory (folder) to single page in same subdirectory

From Dev

apache/.htaccess: incorrect page does not redirect to custom 404

From Dev

apache .htaccess redirect with modrewrite

From Dev

Apache htaccess redirect file

From Dev

.htaccess 301 redirect Apache

From Dev

Apache htaccess redirect file

From Dev

Apache Redirect (using .htaccess)

From Dev

.htaccess - redirect to specific page + redirect to /

From Dev

Redirect to mobile page in htaccess

From Dev

htaccess redirect of a modrewritten page

From Dev

redirect with htaccess to * page

From Dev

Redirect page via htaccess

From Dev

Redirect a page to index in .htaccess

From Dev

Apahce/.htaccess - Redirect all requests to a single page except assets used by that page

From Dev

Apache home page redirect

From Dev

.htaccess Redirect loop on apache 2.4

From Dev

.htaccess Redirect loop on apache 2.4

From Dev

How to redirect a page to a heroku app

From Dev

.htaccess file unable to redirect page

From Dev

htaccess to redirect to Facebook Page temporally

From Dev

.htaccess redirect root to a specific page

From Dev

htaccess page redirect on parameters condition

From Dev

Htaccess multiple redirect for one page

From Dev

htaccess redirect query is not loading page