Results 1 to 3 of 3
  1. #1

    Apache redirects in httpd.conf on ubuntu server using VirtualHosts

    Hi, first post to WHT.

    I am hosting on an Ubuntu VPS with ramnode.
    I have moved servers(shared to VPS), CMSes(drupal to custom PHP/Smarty), and Domain names.

    I am trying to accomplish the following:
    Redirect (301) from exact old url-path matches to exact new urls
    And redirect all other, non-matched old domain urls to the base new domain AND redirect www . newdomain . com to domain . com

    It is my understanding that since I have complete control of the server, I should really be using Apache config files to accomplish this as opposed to .htacces - I would like to figure this out rather than fall back to .htaccess rules then, so I can draw on it in the future. It has been difficult for me to weed out the vast majority of .htaccess-based instructions on the web.

    This is what I have tried in order to accomplish this:

    Both old and new domains are hosted by the one server.
    I have setup two separate files in /etc/apache2/sites-available/
    I tried to put my virtualhosts file content in here but I can't post anything that looks like a url, and it defeats the purpose if people can't tell what I mean, so I made pasties - sorry. I spent a while trying to tweak a little and post and always the same FU message.

    #virtualhost file for olddomain
    pastie dot org /8557108
    For the old domain, I setup two directories in /var/www - one for future use of the original domain name and one to continue to represent the exact matched old domains (I did it this way to test with .htacces files initially)
    #virtualhost file for olddomain
    pastie dot org /8557118
    I then put my redirect rules into /etc/apache2/http.conf (it is included in apache2.conf)
    pastie dot org /8557121
    (N.B. - not sure why boards don't white list some obvious example links like these)

    None of it seems to work.

    Can anyone help me get this setup straightened out?

  2. #2
    Join Date
    Mar 2003
    Moved > Hosting Security and Technology.
    Specially 4 You
    JoneSolutions.Com ( Jones.Solutions ) is on the net 24/7 providing stable and reliable web hosting solutions and services since 2001

  3. #3

    There was a secondary problem

    I had a locales issue that was causing my urls to not get encoded correctly. I'll take another shot at this setup now that that's fixed.

Similar Threads

  1. apache 2 - httpd.conf
    By tomazo in forum Dedicated Server
    Replies: 12
    Last Post: 09-15-2008, 08:56 PM
  2. Apache 2.2 and httpd.conf
    By azn_romeo_4u in forum Hosting Security and Technology
    Replies: 2
    Last Post: 03-06-2008, 07:37 AM
  3. Apache server httpd.conf question
    By Nocturnal01 in forum Hosting Security and Technology
    Replies: 5
    Last Post: 11-28-2005, 09:40 PM
  4. deleting multiple virtualhosts from httpd.conf
    By hostchamp in forum Hosting Security and Technology
    Replies: 9
    Last Post: 08-16-2002, 04:20 AM
  5. editing the /apache/conf/httpd.conf in Cpanel by any user?
    By Ironlung in forum Web Hosting Lounge
    Replies: 0
    Last Post: 11-09-2001, 02:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts