mod_rewrite help?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All,

I'm having issues with mod_rewrite and Apache. Hopefully someone can
offer some tips / help.

I'm looking for something simple:

(a) http://www.website.com -> http://www.website.com/blog
(b) http://website.com -> http://www.website.com/blog

Also:
(1) https://www.website.com -> https://www.website.com/blog
(2) https://website.com -> https://www.website.com/blog

(note that HTTP is NOT redirecting to HTTPS)

My htaccess looks like this:

% cat .htaccess
Options +FollowSymLinks
RewriteEngine on

# http traffic redirect to blog
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^website\.com [NC]
RewriteCond %{HTTP_HOST} ^www\.website\.com [ [NC]
RewriteRule ^(.*)$ http://www\.website\.com/blog [L,R=301]


# https traffic redirect to blog
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^website\.com [NC]
RewriteCond %{HTTP_HOST} ^www\.website\.com [NC]
<not sure what else to put here>

I know I've had this working before, but the htaccess does NOT result
in the browser redirecting to /blog.

Any help would be greatly appreciated!

Thoughts?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux