Forum Moderators: phranque

Message Too Old, No Replies

Including a Java Script file with htaccess

JavaScript via htaccess

         

irldonalb

3:06 pm on Jul 7, 2004 (gmt 0)

10+ Year Member



Hi guys,

I have a folder on my web server with a couple of thousand html files. I now realize I need to include a JavaScript function call and each file as the browser loads these files.

Is there anyway, with htaccess and/or mod_rewrite that I can include an external JavaScript file each time a page is loaded.

Thanks

Donal

jdMorgan

5:35 pm on Jul 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



irldonalb,

Welcome to WebmasterWorld [webmasterworld.com]!

I think you'll need to look for a good multi-file editor. For all practical purposes, .htaccess works at the http request level and not at the file-access level. You'll need to add an "include" function to each of your pages. You can use either an external javascript include, or use SSI to include any type of text-based file in each page.

Jim

irldonalb

10:59 am on Jul 8, 2004 (gmt 0)

10+ Year Member



Thanks Jim

I thought about doing this but the problem is I don't want to have to download all my files to do a simple find and replace. Can i do it on the unix box.

I've had a play around with command line find and replace but i don't think its working.

D.