top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Apache: virtualhost redirects to root on mobiles

+2 votes
318 views

I setup an apache server a while back without a virtualhost and got everything working fine. I added a virtualhost and it seems to work fine on desktops, but on our phones (an iphone and a windows phone), both redirect to my root site if the user adds www to the domain in the address bar.

I assume its just some mistake in my virtualhost setup, but I dont understand why it works on desktop but not mobile. I added a ServerAlias to include the www prefix onto the domain and restarted apache, but it doesnt seem to make a difference. I always get the "root" (hope Im using the right naming convention) host back.

posted Jan 30, 2014 by Seema Siddique

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Try creating a server alias and restart apache.

DocumentRoot /www/server1 
ServerName example.com ServerAlias www.example.com 
answer Jan 30, 2014 by Abhay Kulkarni
Similar Questions
+2 votes

My url has # in the url. Could some one suggest how to use this to redirect. I do not have control over how the url is being generated as its a software product. The below rule does not seem to work.

RewriteRule ^(/share/page/repository#)$ /share/page/context/mine/myfiles [B,R]

I tried to escape the hash with [^c], but it does not seem to work..Any clues on how to handle " # "

+1 vote

I need to change a domain name example.com to www.example.com for example when i enter in the URL like example.com it should automatically redirects to www.example.com

For example enter the URL in browser algoosdigital.com it automatically redirects to www.algoosdigital.com

+1 vote

I have a strange behavior and using tomcat7 on a debian.

My problem is that when in a browser I am writing mysite.com I am redirected with to www.mysite.com.

I am using the node host with some nodes alias.

I have searched in many configuration file and also on google but I do not find any answer to my behavior. Please help?

+2 votes

I am attempting to set a VirtualHost to Alias two directories, and proxy everything else to a Gunicorn server (adding SSL in passing). The VirtualHost is:

 ServerName abc.xyz.com 
 Alias /media/ "/home/xxx/media/"
 ErrorLog /var/log/apache2/error.log
 Options Indexes MultiViews FollowSymLinks 
 AllowOverride None
 Order deny,allow
 Deny from all
 Allow from 127.0.0.0/255.0.0.0::1/128
 Alias /admin/static/ "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/"
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order allow,deny
 Allow from all
 Deny from none
 ProxyPass /media/ !
 ProxyPass /admin/static/ ! 
 ProxyPass / http://localhost:8080/
 ProxyPassReverse / http://localhost:8080/

 SSLEngine On
 SSLCertificateFile /etc/apache2/ssl/ssl.crt
 SSLCertificateKeyFile /etc/apache2/ssl/ssl.key

Any ideas as to what here is causing trouble?

+1 vote

Is it possible to configure Apache 2.4 to accept only one connection at time on port 443? is this something I can configure for my Virtual Hosts?

...