Page 1 of 1

file aliases with apache?

Posted: Thu Dec 03, 2009 6:07 pm
by daedalus__
yoitsdaedalus and he as a question.

i keep a directory called with jquery in it. okay?

so let's say i wanted to reference jquery.min.js in an html file but have it point to /webroot/jquery/jQuery-min.1.3.2.js (or whatever)

this way instead of linking to a path that requires that extra re-write when uploading or having to replace files when i get an update to jquery, i could easily update jquery across the sites on my development machine.

following? please advise.

thanks!

Re: file aliases with apache?

Posted: Thu Dec 03, 2009 6:17 pm
by John Cartwright
I removed the link to your you-tube video. Unfortunately, we have minors here, so keep the content focused and appropriate. Thanks.


As for your question, perhaps you could create a mod_rewrite rule to which all your paths will point to, and the rule uses the latest version.

Code: Select all

RewriteRule ^public/jquery/jquery-latest.js$ public/jquery/jquery-1.3.2.min.js
I generally don't like this approach as the codebase at the time was designed for a specific version of jquery. Updating the jquery library across your libraries would undoubtedly break some functionality down the road.

Re: file aliases with apache?

Posted: Thu Dec 03, 2009 7:01 pm
by daedalus__
yum. i dont have a lot of experience with apache but i recently moved to ubuntu. ill look up the docs to mod_rewrite. im going to have to use it for clean URIs anyway.

what you said about updating jquery breaking functionality is true, but if it is a site that i plan on maintaining minimally or not at all i could still just include it a more 'normal' way.

:) thanks!

p.s. but you watched it and it was good, righht? :)

Re: file aliases with apache?

Posted: Thu Dec 03, 2009 7:03 pm
by John Cartwright
daedalus__ wrote:p.s. but you watched it and it was good, righht? :)
I watched the first 15 or so seconds (I was already familiar with the video), although I already forgot which it was :D