Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

  1. Website A
  2. 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] 
share|improve this question
    
It's hard to tell without more info (such as if you're using a CMS platform, redirect scripts/modules, etc...), but it sounds like your server is redirecting your mobile browser user-agent from website B to website A, so I'd look at .htaccess in website B and your server config file. Also be sure to clear your mobile browser's cache. –  dan Sep 18 '13 at 4:11
1  
Thanks for your reply @dan I am using Joomla for Both my sites. Here is the .htaccess of my second website 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] –  Faheem Rasheed Sep 18 '13 at 6:34
1  
It's probably better to edit this in in your question. It makes it a lot more readable. –  Ivo van der Veeken Sep 18 '13 at 7:50
    
This question is very specific to your setup. Other people are unlikely to have similar enough setups for this to be helpful to them. –  Stephen Ostermiller Oct 20 '13 at 11:23
add comment

closed as off-topic by Stephen Ostermiller Oct 20 '13 at 11:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because it is unlikely to help anybody else. Examples include individual website reviews for SEO purposes and general website troubleshooting." – Stephen Ostermiller
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

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 www.example.com

# Other directives here

</VirtualHost>

<VirtualHost *:80>
DocumentRoot /www/example2
ServerName www.example.org

# Other directives here

</VirtualHost>

http://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: www.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.

http://www.designyourway.net/blog/resources/detecting-and-redirecting-mobile-users/ OR Google https://www.google.com/search?q=automatic+redirect+mobile+devices

share|improve this answer
    
Thanks @krowe I am using Joomla for my sites. –  Faheem Rasheed Sep 18 '13 at 6:38
    
and i dont have access to my http.conf file. Also , the sites are different that why i have put them in different folder's. –  Faheem Rasheed Sep 18 '13 at 6:52
    
As your links mention about redirecting to a mobile site.I dont want to redirect.My problem is that Website B is redirected when accessed through a mobile to the mobile site of Website A which i dont want.i want the website B to b loaded when it is requested for website B not Website A. Regards :) –  Faheem Rasheed Sep 18 '13 at 7:03
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.