Subdomain doesn't show images from root Domain (Drupal) - .htaccess

I have a site up and running using Drupal.I use a web-hosting service, that uses Plesk 12 panel.Recently I decided to add a subdomain for the mobile version of my site.So I created a subdomain inside Plesk, pointed it to www.mydomain.com and named it m.mydomain.com.My desktop site is in httpdocs folder and my mobile version in m.mydomain.com folder.Then I added redirection to my mobile site when a mobile device is detected.
The problem is that m.mydomain.com does not show images because they are uploaded in httpdocs/sites/default/files which is my desktop site.Is there a way to access that folder from my subdomain?I have no access to http config files.Is there a way to do this from .htaccess file of my sub-domain?
*UPDATE
My structure is:
root
-----httpdocs
----------desktop site folder
-----------------desktop site files
----------mobile site folder
-----------------mobile site files
----------images

The best option I can think of is to use the Drupal module Domain Access.
From the module's page:
The Domain Access project is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database.
Using that, you should be able to apply a different theme to the subdomain site than what you are doing with your main domain. You could use JavaScript or the like to redirect people to the subdomain.
The second option is that there is already a module called Mobile Tools that allow you to change theme and other settings for mobile devices. The description for that module page is as follows:
The Mobile Tools module provides Drupal developers with some tools to assist in making adjustments to your site based on the visitor's device.
It was mentioned in this question, "How to redirect users to mobile site". However, I must caution you against using the Mobile Tools module as it is only in development, and the last contribution to it was 3 years ago. (Plus they have a big warning on their module page that says "Do not use on production".)
Either of these modules should be able to get you started in the right direction.

Instead of doing a redirect, I would place the images in a folder accessible to both systems. My understanding is right now you have something similar to...
site1/images
site2
If you move your images folder higher in your folder architecture to the same level as site1 and site2 and you update your Public file system path and Private file system path in the media configuration to be that directory it will resolve your issues. Essentially your folders will end up looking like this.
site1/
site2/
images/

Related

How can I redirect a concrete5 website to addon domain

I installed concrete5 CMS in main domain folder and created an addon domain pointing to the main domain, but after creating the full website, when I redirect it from cpanel, the navigation is not working at all. You can see it by clicking following link:
the link where I build the site: http://www.venturescontracting.com/venturestowing
after redirect the addon domain http://www.venturestowing.com/
Please help me. How can I permanently redirect to the addon domain correctly?
Edit update: Oops. Looks like this is all fixed now. All okay? Original note follows, as the concept of "subdomains all" makes some sense...
Have you seen this link on best practices for hosting multiple concrete5 domains? Basically you place each 'site' in a separate directory, such that no one site his hosted at the root (public_html)... Everything is in subfolders from the root directory, and registered as a subdomain. Then you point the domain A-record to the IP address of your hosting site. Your hosting site (which appears to be Godaddy) can help you do this. They have pretty good tech support via phone 24x7

Virtual directory problem in IIS for asp.net web application

My asp.net web application works fine locally and when I deploy it as the default web site on my test server. So for example, when I type http:// 10.10.10.100 it works fine.
I created a virtual directory called "Test" under my "Default Web Site".
When I type http://10.10.10.100/Test it loads correctly to my log-in page, however when I log-in and click on a link it goes back to my log-in page and the url goes back referencing http://10.10.10.100 instead of http://10.10.10.100/Test/Default.aspx, for example.
My goal here is to run my application from the virtual directory and not as the default, but I don't want to change my code to a hard coded path since then it won't work anywhere else.
Any workarounds for this?
You have left a few unanswered questions, but some things to check:
Which links are you using? In other words, are they plain HTML links (<a href=""> links), ASP.NET links (<asp:HyperLink>), LinkButtons (<asp:LinkButton>), etc.?
How are you specifying the URL in those links? ASP.NET has a "shortcut" for root directory of the website if you use the tilde (~) character. So, to link to a page on your site called "MyPage.aspx", you might use "~/MyPage.aspx".

Can I develop my own websites on my friend website server?

If I buy a hosting (+ domain) service for the website of a friend of mine, and then I decide to use the remaining web space and mysql databases for my development and test...
is google caching my development websites (in other folders and sub-urls) under his website ?
What's the downside to develop on a server with already a production website.. ? I was thinking to create a tiny url linking to a www.myfriendwebsite.com/mydevelopmentSite.. in order to hide the real url.
Thanks
If you don't link to it or don't submit to google or list in a sitemap -- google won't find it.
But, you could also just use a robots.txt to tell google not to index it.
http://en.wikipedia.org/wiki/Robots_exclusion_standard
Update: to stop google and malicious bots:
Put a directory in robots.txt using *, and then put your site in a hard to guess subdirectory of that directory -- also, don't keep directory browsing on.
Also -- don't link to it anywhere, but perhaps you can't stop others from linking -- in that case, only robots.txt will keep you out of google. Malicious bots can get the site from the link.
Your hosting provider may have forbidden that in his Terms of Service (mine has). Other than that, I'd go for a subdomain instead of a subdirectory (like mydevelopmentsite.myfriendswebsite.com).

How do you make a CMS and existing asp.net applications live together peacefully in IIS?

Note: I originally posted this on ServerFault, but I haven't gotten any responses at all. Since it looks like I'm on track to get the Tumbleweed badge over there, I figured I would try here also.
Our existing public website consists of a mish-mash of asp.net pages with mostly static content and some real web applications that are set up as virtual directories. We're now looking at installing Umbraco, which requires that you install it at the root of the website.
Since the CMS would be at the root of the website, I'm assuming it's a bad idea to run our existing pages and web applications underneath Umbraco (due to the URL rewriting it performs and inheriting web.config settings, etc.) So how do we make everything co-exist peacefully both while we transition to the CMS and after we're finished?
My only idea so far was to set up the CMS and the applications as separate websites and then use some sort of URL rewriting/reverse proxy to make everything resolve correctly:
* www.example.com would keep resolving to our old homepage
* www.example.com/dept1 would keep resolving to the old dept1 page
* www.example.com/dept2 would resolve to the new dept2 page on the CMS
* www.example.com/app would resolve to an existing web application
We ending up setting up Umbraco as it's own website in IIS and then we bought ISAPI Rewrite so that we could seamlessly pass through CMS content for certain URLs.

IIS Configuration. 1 Domain, multiple applications

I'm having a bit of a problem here.
We have 2 urls let me call them http://www.testUrl.com/ and http://www.test-url.com/
This url points to a server using an "A-Record".
In IIS I've appointed these url's through "Advanced Website Identification" to the correct application.
Now we have 2 apps. One application is version one the other is the more advanced application.
Now my boss wants me to link one url to 2 different applications.
So when you surf to http://www.testurl.com/ or http://www.testurl.com you see the latest version but when you surf to http://www.testurl.com/folderinversion1/ you'll see the folder of the first application.
It's a though situation and I don't think there is a solution but I wanted to double check if you can assign 1 url to 2 applications.
Can you not just create a virtual directory called /folderinversion1 in the site for testurl.com pointing at the application root that is currently on the other site?

Resources