How do I redirect requests coming to http://blog.mysite.com to http://mysite.com/blog?
Reading the apache docs on when not to use the rewrite mod, I tried a simple redirect e.g.
Redirect http://blog.mysite.com http://mysite.com/blog
But when I visit http://blog.mysite.com, it doesn't redirect me. Any suggestions?
I'm trying to redirect multiple VirtualHosts without a preceeding "www." from one VirtualHost to another, like so:
<VirtualHost *:80>
ServerName example.com
ServerAlias example.org
ServerAlias example.net
# I either need some kind of Apache conditional here...
Redirect 301 / http://www.example.com/
# ...
#Hide Index
IndexIgnore *
#Define ErrorDoc
ErrorDocument 404 http://www.domain.com
#REDIRECTS
Redirect 301 /page.php http://domain.com
Redirect 301 /inc/page.php http://domain.com
Options +FollowSymlinks
RewriteEngine on
#Redirect all pages in a folder to a single URL
RewriteRule ^dir/(.*)$ http://domain.com/index.php [L,R=301]
#Redirect String
RewriteRule ^index.php?var1=value&var2=(.*)
My ELB keeps taking my instances out of service, because the HTTP health check is failing.
We have a DNS wildcard, and redirect everything to www:
vhost.conf:
ServerName www.example.com
ServerAlias *.example.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^ http://www.example.com/$1 [R=301,L]
This works fine for actual browsers, but the HTTP health check to
I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code Im useing is:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$
RewriteCond %{HTTP_HOST} ^.*site1.com [NC]
RewriteRule ^(.*)$ http://www.site2.com/$1 [R=301,L]
What I want is to redirect all requests except 1.2.3.4 IP from site1 to site2.
I have the following on my .htaccess file within /var/www/html folder.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.net [nc,or]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com\.au [nc,or]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent, NC, L]
I want all domain.net and domain.com.au requests to redirect to domain.com.
I have an apache server under a proxy that can run HTTPS.
I installed Redmine and so far everything runs smoothly.
Now i want to add a rewrite rule via .htaccess in order to redirect requests from domain.tdl to www.domain.tdl.
This is approach works fine with my everyday php projects:
RewriteEngine On
RewriteBase /
# redirect all pages w/o www to www.
RewriteCond %{HTTP_HOST} !^www\.domain\.tdl$
RewriteRule ^(.*)$ http://www.domain.tdl/$1 [L,R=301]
I am trying to use .htaccess to make one page on my site redirect to it's https counterpart. The checkout.php page lives in the root / html folder of the site. ( /checkout.php ). I tried using this : (which i found online somewhere). I put it up and got an internal server error.