Reputation: 103
I've a domain and a subdomain with this structure:
Domain: mydomain.com
Subdomain: m.mydomain.com (which "mydomain.com/mobile/" is the folder)
While I'm on mydomain.com, I upload images to the folder "images", this is the structure:
mydomain.com/images/image.jpg
And I've no problems with it, because the folder /images/ is in the domain.
Now, when I'm in m.mydomain.com, how can I upload images to the domain folder (mydomain.com/images) and not to the subdomain folder (m.mydomain.com/images)?
Thank you guys
PS. I'm using Routing with both domains, with the index.php as "router"
Upvotes: 0
Views: 698
Reputation: 3288
Since m.domain.com is in domain.com you can use m.domain.com/images for both.
Use the same directory for both domains and use .htaccess to route the mobile to index.m.php or something like that in the same directory.
More complicated. You can serve files through a url page built in php. Basically just a page that takes the file name searches for it in the server directory outside the site and dumps the content with appropriate headers.
Similar to 2 you can route both mobile and normal to the same directory. Detect in index.php if the subdomain is specified and load the site files from your mobile folder. This is my preferred method.
Upvotes: 1