Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to redirect users to sub-directory 1

Status
Not open for further replies.

gmail2

Programmer
Jun 15, 2005
987
IE
We've currently got a windows host (2003 SP2) running apache2. The URL that users will need to access is server.mydomain.com/cgi-bin/myfile.cgi

We're planning on creating an alias (intranet.mydomain.com) for users to access - but we don't want to them to have to type in cgi-bin/myfile.cgi. I know that we can just set cgi-bin as the root directory in apache, but I think this may cause other problems (it's a custom written app written by a 3rd party). What would be the best way to have the user access the correct file just by typing in the address ? It can either append /cgi-bin/myfile.cgi or just serve up that page without appending the directory to the URL.

I guess I need HTTP re-directs, but I know that apache has alot of other functions that I'm unfamiliar with so I'm hoping that somebody can give me the best option for this. The server will be quiet busy so we'd like to go with the option that will have the lease performance impact also

Thanks in advance for any help, much appreciated

Irish Poetry - Karen O'Connor
Irish Poetry and Short Stories - Doghouse Books
Garten und Landschaftsbau
 
Hi

gmail2 said:
I guess I need HTTP re-directs
Not necessarily.
gmail2 said:
I know that apache has alot of other functions that I'm unfamiliar with
You only have to get familiar with the Apache Tutorial: Dynamic Content with CGI how-to.

Web servers usually can identify CGI scripts in two ways :
[ul]
[li]by path[/li]
[li]by extension[/li]
[/ul]
Apache can do both.

As you not want the first way, try the second. Start by reading about the [tt]AddHandler[/tt] and [tt]Options[/tt] directives.

Feherke.
 
Use DirectoryIndex directive in your apache configuration file(apache/conf/httpd.conf).and give index.php to be first called in tha directive.for this add
DirectoryIndex index.php line in httpd.conf fiel.

create a index.php file in root folder of your server(htdocs)
and redirect the page to your page by using header("Location:mypage.php").
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top