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 |
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.
|
..if u want to configure it inside of apache, look for mod_rewrite....or use a script! ;-)
|
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) |
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 ????? |
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> |
All times are GMT -5. The time now is 04:02 PM. |