Avoiding Index

Published on 11/21/09 at 22:08:58 MDT by SafePit

ProgrammingOne thing that always bugged me with using scripts is that you tend to see the script name. For example, this site has always had an index.cgi and most PHP sites have index.php in the links. I find it tacky and many commercial sites don't do this. I don't want to change my software, so there has to be a way around this problem. The search is on!

Some time ago I figured out how to redirect directly to my script from my main site's URL. The most obviously method is a little HTML redirect script in your home directory. This is what Web-APP came with, an index.html script with either a meta tag or JavaScript. This allows you to use the base URL to get to the site, but users still see the index.cgi.

If your server supports it, that you can use a service side include (SSI) to redirect to your script name. For example:

<!--#exec cgi="cgi-bin/index.cgi"-->

This prevents your script name from showing up in on entry; however, it will still show up in all the script links unless you modify your configuration to use your root domain as your script name.

Curiously, I found I could do the same thing without the extra SSI call. If you are using Apache and your host supports .htaccess files, add the following line to it:

DirectoryIndex cgi-bin/index.cgi

This works great and I've been able to almost completely eliminate having to see "index" my site's URL.

Printer Friendly version - Avoiding Index  Log in to use this feature  (478 reads)    All Articles by SafePit

Tags:

Apache  CGI  index  javascript  Perl  programming  redirect  scripts  SSI 

Comments on this article:

 Avoiding Index | 0 comments | Post comment

The comments are owned by the poster. We aren't responsible for its content.
 
No comments so far.
 
 Write a comment:
 
Name:
  Leave name blank to remain anonymous.
E-Mail:
Type The Letters You See.
[captcha image][captcha image][captcha image][captcha image][captcha image][captcha image]
not case sensitive

Subject:  
Text:
     


SafePit's Gamercard
Slide: p-m367-l_th.jpg

Feeds

Main Menu

Choose

Presence

Other Sites

Badges

Who's Amung Us?
Join My Community at MyBloglog!
WebAPP CMS
carbon neutral offers and shopping with kaufDA.de

August  2010

SMTWTFS
1234567
891011121314
15161718192021
22232425262728
293031    
       
<< prev next >>

Tag Cloud

Information

Online Now

0 Member(s)
2 Guest(s)
1 Robot(s):
Google
Log in to see who's on.
Most ever on: 106
Membership: 6
Welcome to our newest member: meyeatts

Login

Username:
Password:
 Remember Me?

Forgot password?
You are a guest user.
You can register for free by clicking here.