Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Apache 2.2 with WHM / cPanel. Let me know what other info you need to answer this question.

I want to set up some kind of forwarding/redirect so that the following occurs:

_ (ignore the underscore, couldn't post actual links)

actually sends you to


This can be overt (your browser address bar changes) or not, it doesn't really matter (although if I get to pick I would prefer the address bar NOT change).

My initial thought was to use a CNAME, but I've since learned you can't include a port in your cname. Now I'm thinking I have to do something with my Apache VHOST?

I am very much a novice at apache / web server internal workings, but I know my way around a command line well enough.

share|improve this question

closed as off-topic by HopelessN00b, Jenny D, MadHatter, ptman, HBruijn Feb 23 at 19:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Perhaps you could use mod_proxy? Something like this in your virtual host configuration should do the trick (not tested)

    ProxyPass /

Make sure to read the docs as I haven't used it myself.

share|improve this answer
If you do use the Proxy module, learn from my mistake. DO NOT ENABLE ProxyRequests (ie set it to "On"). You will turn into a HTTP proxy. The documentation says your server could be used to send email, which is very misleading as it can do a whole lot more than just that. – Nathan Adams Jun 5 '10 at 23:08

Is there any reason you can't have a redirect page sitting on bouncing you to the new page?

(Untested) example in PHP, since I'm a PHP type of guy.

<?php header('Location: http://newurl:newport'); ?>

share|improve this answer
Hmmm OK, my chunk of code doesn't want to be displayed :/ (presumably from lack of backticks) – Ben Pilbrow Jun 5 '10 at 22:17
You're missing a Location: in that header, so it would be header('Location: newurl:newport'); – kaerast Jun 5 '10 at 22:52
Arg so I was (updated) - I did that in my head, honest! iPhones weren't designed for this!! – Ben Pilbrow Jun 5 '10 at 22:55
It's a better idea to use proxypass to make it seamless, or a redirect (mod_rewrite or mod_redirect) so users get the 301 moved. SEO generally likes this better anyway, if you're worried about that at all. – Chris S Jun 6 '10 at 2:06