Mobile app version of vmapp.org
Login or Join
Smith883

: Mobile traffic of my second site redirected to my base site [Edited,have a look] I have a strange issue with my website and it seems i am unable to understand what cauese the problem.I would

@Smith883

Posted in: #Htaccess #Redirects

I have a strange issue with my website and it seems i am unable to understand what cauese the problem.I would highly appreciate your help.The Scenario is

I have two websites.


Website A
Website B


Website A is simply hosted within the root directory of my hosting account.Within this root *directory* i have a sub folder " subfolder A " and within which is another subfolder " subfolder B " that contains my site Website B

so the path looks like

root/sublfolder_A/subfolder_B/

that contains my **Website B ( i.e subfolder_B) **

All goes fine.When i access the website B from my desktop/Laptop Website B is loaded normally.

but when i access the Website through a mobile device , mobile site of Website A is loaded while as it should load website_B

Also , to let you know , both websites have different URL's and not subdomain's or anything.

What could be the problem ?
htaccess of website B or website A ? or something else ?

Here is the htaccess of my website B

RewriteEngine On
RewriteRule .* index.php [F]
RewriteBase /
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Smith883

1 Comments

Sorted by latest first Latest Oldest Best

 

@Connie744

It sounds like you haven't properly configured your web server. Since you've mentioned .htaccess files I'm going to assume that you're using Apache web server. Depending on your OS the layout of your web server configuration will vary. If you're using a Redhat variant or Windows then your configuration will all probably be in one file. If you are using a Debian variant then you likely have a site-available and sites-enabled directory with each site in separate files. Figure out how yours are laid out and look for the VirtualHost configurations. In the configurations which use files in site-available this will go in 2 separate files and in the more standard installations this will all be near the end of httpd.conf. Here is a sample configuration script which does what you are trying to do:

# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www/example1
ServerName example.com
# Other directives here

</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/example2
ServerName example.org
# Other directives here

</VirtualHost>

httpd.apache.org/docs/2.2/vhosts/examples.html
I would put these two sites in the same directory as they have done in the sample. If the content of the two sites are the same then I wouldn't use separate DNS names. Just use separate virtual host name. So name the sites: yoursite.com and mobile.yoursite.com.

Once that is setup you'll probably want to redirect to the mobile site automatically when someone visits with a mobile device. This is a long topic in itself so I'll leave that as further reading.
www.designyourway.net/blog/resources/detecting-and-redirecting-mobile-users/ OR Google www.google.com/search?q=automatic+redirect+mobile+devices

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme