LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-09-2004, 12:15 AM   #1
veritas
Member
 
Registered: Aug 2003
Location: Dallas,TX
Distribution: Ubuntu Server, Slackware, Red Hat 6.1
Posts: 241

Rep: Reputation: 30
how do i do this with apache?


Hi, im using apache version 1.3 and i need to know how to do something.

I am trying to redirect users that come to the site to the /var/www/htdocs/modules/news. I tried the option DocumentRoot, but the problem with that is it wont let the files in modules/news use things lower than the modules folder, so basically it wont work like that.

Is there an option to just link them to that when visitors go to the root of the website instead of actually setting that as the root?
 
Old 03-09-2004, 03:59 AM   #2
urzumph
Member
 
Registered: Jan 2004
Location: Australia
Distribution: Debian
Posts: 168

Rep: Reputation: 30
depending on what "/var/www/htdocs/modules/news" is, this may or may not work.

You can simply sym-link index.html in your DocumentRoot directory to the news page you want to use. However this could cause some problems, especially if what you have in news is a PHP / other script. Another complication is if /var/www/index.html actually exists and is a valid page you want to visit. If it's a valid page, then the best I can recommend is something like page-redirection based on referrer fields, but that could come un-stuck if people turn it off for privacy reasons. (sorry, I can't give advice on that, I have never learnt HTML/JS)

to sym-link :

ln -s /var/www/htdocs/modules/news/index.html /var/www/index.html

(I think those are in the right order lol)
 
Old 03-09-2004, 07:29 AM   #3
Satriani
Member
 
Registered: Mar 2003
Location: The Netherlands
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418

Rep: Reputation: 30
You could also put a simple index.html in your docroot containing:
Code:
<HTML>
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=/modules/news"> 

 <SCRIPT LANGUAGE="JavaScript">

 function reDirect() {
    document.location='/modules/news/whatever.html';
  }

 </SCRIPT>

 <BODY onload='reDirect()';>
 </BODY>
</HTML>
This will definitively redirect the user... If META tag is misunderstood, it will start the JavaScript function... If it goes wrong now, well they have a serious problem... You might want to add a text in the body with something like: Redirecting you, if not working, <a href="your-url">click here</a. ... Just to make your visitors have the possibility to escape...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail from Apache being rejected - Cannot route to sender apache@localhost.localdomain jimwillsher Linux - Networking 2 01-19-2006 12:41 AM
Apache 1.3.33 (debian built) and Apache SSL does not respond to the proper ports lqorg_user Linux - Networking 0 11-06-2005 04:11 PM
Strange apache trailing / problem - Slack-current, apache 1.3.33 vamp Linux - Networking 1 01-30-2005 07:28 PM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration