Forum Moderators: coopster
always make backups before doing foolish things like this!
1.2.3.#!/usr/local/bin/perl
#
# Usage: rename perlexpr [files]
($regexp = shift @ARGV) ¦¦ die "Usage: rename perlexpr [filenames]\n";
if (!@ARGV) {
@ARGV = <STDIN>;
chomp(@ARGV);
}
foreach $_ (@ARGV) {
$old_name = $_;
eval $regexp;
die $@ if $@;
rename($old_name, $_) unless $old_name eq $_;
}
exit(0);
4.6.DirectoryIndex index.jsp
AddType application/x-httpd-php .jsp
7.et voila, they get their site in jsp
now stop bugging me ;)
And has done so for many years. This would make Jatar_k's solution so much easier.
Have the site set up so that it doesn't use extensions, BUT, it does use mod_rewrite to do two things:
1. it lops off any extension and, for the purposes of finding the file, throws it away.
2. it takes the extension and rewrites it as a GET parameter 'ext'.
3. all inernal urls on the site are constructed by putting in the
$url . "." . $_GET['ext']
Now everyone gets a site with their favorite technology.
1. For execs who have heard about the W3C, they visit the site as it designed :
h**p://domain.com/page
They are impressed. Wow! No extensions. These guys know what they're doing.
2. For execs who believe that any cutting edge site will use JSP, Jatar_K says, "Oh we already have a JSP version of the site" and tells them to visit
h**p://domain.com/page.jsp.
mod_rewrite lops off the "jsp", adds it to every internal URI and serves up the page. Once again, the execs are impressed. Wow! We have a JSP site! These guys are good.
3. The execs ask "What about XML? Isn't that replacing HTML? Shouldn't we have some somewhere on our site?" Jatar_K responds: "Oh, everything is already done with xml. We have an alternative xml site for 'power users'. Just go to h**://domain.com/page.xml". Now the execs are really happy because, one the programmers they have are really good and two, they, the execs themselves are 'power users' because they are now visiting the xml site, not the regular old JSP site that the ignoramuses below them use. Give the programmers a raise.
4. The execs keep hearing that there is this RSS thing and that it's somehow related to web pages or something. They're not really sure, but they're pretty certain that it's something you can see in a browser if your programmers are good and up on the latest technologies. At the 4:00pm meeting on Friday, one of them who wants to wow everyone with his technical knowledge says: "Should we have some of that RSS stuff on our site." Jatar_K takes on his most pensive look and after about 15 seconds reflection says, "Well, it's really a technology that's only appropriate for the *most* tech-savy executives, so I've been skeptical of implementing it here. I'll see what I can do over the weekend." Over the weekend, Jatar_K watches a few movies, gets together with friends. Doesn't think about work for one second except to do two things. First, he does not shave all weekend and second he goes out and drinks far more than is good for him, especially on Sunday night. He shows up on Monday morning, late, unshaven and hung over. He's pale, tired and red-eyed. He has either been partying all weekend or staring at a computer screen without rest or respite for every minute since the 4:00pm Friday meeting. The execs aren't sure which until he announces, "Yeah I put together an RSS site this weekend. No big deal. Just go to h**p://domain.com/page.rss".
The execs are beaming. When Jatar_K leaves the room, one of them asks the others, "How much are we paying that guy?"
Tom