Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-10-2005, 03:48 PM
|
#1
|
|
LQ Newbie
Registered: Jan 2005
Posts: 5
Rep:
|
Redirection in Apache
Hello,
I need to redirect from Apache to a different directory on the server. This is what I am trying to accomplish
something.com redirected to something.com/someone
The domain name will stay the same just need to pointed a directory deeper.
Thanks,
konrad
|
|
|
|
02-11-2005, 03:43 AM
|
#2
|
|
Member
Registered: Aug 2002
Posts: 117
Rep:
|
Look into another form of redirection. I've never done this directly inside of apache, and its prolly not even the best way to do it. Try, javascript, if you don't want to do it server side. But if you d`want to do it server-side, I'd go with PHP, then you can send the correct HTTP redirection header, and what you want would be carried out.
|
|
|
|
02-11-2005, 03:50 AM
|
#3
|
|
Member
Registered: Apr 2004
Location: ..where no life dwells..
Distribution: RH,FC/SuSE/Debian/HPUX/OSX
Posts: 509
Rep:
|
..if u want to configure it inside of apache, look for mod_rewrite....or use a script! ;-)
|
|
|
|
02-11-2005, 04:21 AM
|
#4
|
|
Member
Registered: Aug 2002
Posts: 117
Rep:
|
Yeah mod_rewrite will do some crazy stuff, but tricky to configure sometimes. Here's a link to it's config info:
http://httpd.apache.org/docs/misc/rewriteguide.htm
(I strongly recommend, a script method though, like my first post described)
|
|
|
|
02-11-2005, 04:31 AM
|
#5
|
|
Member
Registered: Aug 2004
Location: .au
Distribution: debian, BSD
Posts: 104
Rep:
|
mod_alias will let you add a permenent redirect to wherever you want. Doc for this directive is here .
If you want to redirect your documentroot, your alias will be /
... or you can add a redirect metatag to the HTML source of your index.
<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=someotherurl">
</HEAD>
no crazy php client header management or javascript required...
Either way, the browser needs to refetch the page, so your choice. Having apache handle the redirect is better, as it will redirect *all* requests for that alias. Not just simply on one or two hypertext sources.
but... if its on the same box, why not just adjust your DocumentRoot ?????
Last edited by angrybeaver; 02-11-2005 at 04:40 AM.
|
|
|
|
02-12-2005, 09:54 AM
|
#6
|
|
Senior Member
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154
Rep:
|
in regards to meta refresh, i prefer script alternative... can't remember why i started using these, just that i ran into a problem with a meta refresh somewhere...
though if this is a standing redirect, i would let apache handle it...
Code:
<html>
<head>
<title>Redirecting</title>
</head>
<body>
<script type="text/javascript" language="Javascript">
<!--
document.location="somewhere.html";
//-->
</script>
<noscript>
Your mother was a hampster and your father smelt
of elderberries.
<a href="somewhere.html">This page has moved</a>
</noscript>
</body>
</html>
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:16 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|