You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by James Moe <ji...@sohnen-moe.com> on 2014/10/01 07:33:37 UTC

[users@httpd] Will these rewrite rules do what I expect?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I wish to have three rules
1. if URL = http[s]://info.massamio.com/blog, redirect to
http://blog.sohnen-moe.com/
2. if URL = http[s]://info.massamio.com/resources, redirect to
http://blog.sohnen-moe.com/
3. any other http[s]://*massamio.com/ redirects to
https://sohnen-moe.com/timely/massamio.php

Will the rules below do that?
(I cannot test it directly, yet.)

RewriteEngine on
RewriteCond %{REQUEST_URI} =/info.massamio.com/blog
RewriteRule ^(.*)$ http://blog.sohnen-moe.com/ [R,L]

RewriteEngine on
RewriteCond %{REQUEST_URI} =/info.massamio.com/resources
RewriteRule ^(.*)$
https://sohnen-moe.com/resources/c2a-massamio-resources.php [R,L]

RewriteEngine on
RewriteCond %{HTTP_HOST} =www.massamio.com
RewriteRule ^(.*)$ https://sohnen-moe.com/timely/massamio.php [R,L]

- -- 
James Moe
moe dot james at sohnen-moe dot com
520.743.3936
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlQrkjEACgkQzTcr8Prq0ZPm0wCfdiQ/6rxmaBdW52BFGfceofbL
DzUAnRUwlZ44CAXAZVq79S2RIV2/G9Fq
=dG+Y
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Will these rewrite rules do what I expect?

Posted by James Moe <ji...@sohnen-moe.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/01/2014 04:30 AM, Eric Covener wrote:
> 
> ​The REQUEST_URI doesn't contain a hostname​. Just the path
> component of the URL.
> 
Having *.massamio.com point to the one IP address then:

RewriteEngine on
RewriteCond %{HTTP_HOST} =info.massamio.com
RewriteCond %{REQUEST_URI} =/blog
RewriteRule ^(.*)$ http://blog.sohnen-moe.com/ [R,L]

RewriteEngine on
RewriteCond %{HTTP_HOST} =info.massamio.com
RewriteCond %{REQUEST_URI} =/resources
RewriteRule ^(.*)$
https://sohnen-moe.com/resources/c2a-massamio-resources.php [R,L]

RewriteEngine on
RewriteCond %{HTTP_HOST} =www.massamio.com
RewriteRule ^(.*)$ https://sohnen-moe.com/timely/massamio.php [R,L]

IIRC, unless otherwise indicated, the ReWriteCond is a set of AND
conditions.


- -- 
James Moe
moe dot james at sohnen-moe dot com
520.743.3936
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlQu4noACgkQzTcr8Prq0ZPIxQCcDwfeoEpf+qaz2neaSt4lJyeW
iXwAoKnvYghX2qPv0IXZJtmflJjidcUk
=9XB6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Will these rewrite rules do what I expect?

Posted by Eric Covener <co...@gmail.com>.
On Wed, Oct 1, 2014 at 1:33 AM, James Moe <ji...@sohnen-moe.com> wrote:

> RewriteCond %{REQUEST_URI} =/info.massamio.com/blog
>

​The REQUEST_URI doesn't contain a hostname​. Just the path component of
the URL.