Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subdomains, .htaccess, and sharing directories



Hi Bill,

I'm using relative links. The reason I'm not using absulute is because I would have to change the php includes and css files to all absolute. I guess that's not a big deal, but it seems a bit of an overkill, or is that what you are simply supposed to do?

In regards to your last questions:

"Is there any specific reason NOT to use absolute urls for those? If you enter sub.domain.com/images/knownimage.jpg does it work? Is .htaccess on? Does Rewrite work for other things, or is this the first you've used it on this machine?"

No. If I enter sub.domain.com/images/knownimage.jpg, it does not work.

Yes, .htaccess is on.

Yes, the Rewrite's are working fine for the site.

The other thought I had, and I haven't tried this yet, was to put a second .htaccess file inside the directory that the subdomain is pointing to, and have the rewrite there. That may be the answer.

Let me know your thoughts.

Thanks,

Mark

------------------------

On Mar 13, 2006, at 5:47 PM, email@hidden wrote:

At 1:30 PM -0800 3/13/06, Mark Wheeler wrote:
Hi,

I'm having trouble "sharing" the same folders in the main (www.mydomain.com) domain with the sub (sub.mydomain.com) domain. Here is what is happening. I put a file in a directory as such:

http://www.mydomain.com/css/main.css

When a file that uses that css file is called within the www.mydomain.com domain, everything works great. But when I call a file that is within a subdomain such as:

http://sub.mydomain.com/index.php

that uses the main.css file above, it can't find it.


Are you using the full URL or a relative link? If sub.mydomain.com does not include /css/main.css within it, you'd do better to use an absolute URL.



My subdomain is pointing to a directory within the main domian as such:


www ---> subdomian_folder

If I use the following url to get to the same file:

http://www.mydomain.com/subdomain_folder/index.php

everything works fine.

Here is what I have in the .htaccess file, but it's not working.

RewriteRule ^(www|sub)\.mydomain\.com/(css|images|js)/ http:// www.mydomain.com/$2

Is there any specific reason NOT to use absolute urls for those? If you enter sub.domain.com/images/knownimage.jpg does it work? Is .htaccess on? Does Rewrite work for other things, or is this the first you've used it on this machine?



-- Bill Christensen <http://greenbuilder.com/contact/>

Green Building Professionals Directory: <http:// directory.greenbuilder.com>
Sustainable Building Calendar: <http://www.greenbuilder.com/calendar/>
Green Real Estate: <http://www.greenbuilder.com/realestate/>
Straw Bale Registry: <http://sbregistry.greenbuilder.com/>
Books/videos/software: <http://bookstore.greenbuilder.com/>


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden
References: 
 >Subdomains, .htaccess, and sharing directories (From: Mark Wheeler <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.