Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 03-09-2004, 01:15 AM   #1
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, 04:59 AM   #2
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, 08:29 AM   #3
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:
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=/modules/news"> 


 function reDirect() {


 <BODY onload='reDirect()';>
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...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01: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 05:11 PM
Strange apache trailing / problem - Slack-current, apache 1.3.33 vamp Linux - Networking 1 01-30-2005 08:28 PM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 06:30 AM
apache benchmarks (apache v13 / apache v20) ; large differences between benchmarking markus1982 Linux - Software 0 02-08-2003 11:53 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:57 PM.

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