1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Redirect subdirectory

Discussion in 'Plesk for Linux - 8.x and Older' started by networkthinking, Nov 21, 2005.

  1. networkthinking

    networkthinking Guest

    We havea site that needs to redirected due to some existing code. The current code uses:

    The directory structure though is:

    Without changing all the code, is there a way to redirect plesk/apache to skip the site1 directory under httpdocs and take people directly to company1?


    The older server(non-plesk) did this but I cannot find the redirect or how it is done.

  2. brucew

    brucew Guest

    Try this in your .htaccess file:
    Redirect /company1 [url]http://www.abc.com/site1/company1[/url]
    If this is a permanent change, use RedirectPermanent instead of Redirect so that Google et. al. will update their indexes properly.

    For your reference: http://httpd.apache.org/docs/1.3/mod/mod_alias.html#redirect
  3. ShadowMan@

    ShadowMan@ Guest

    Or you could try using mod_alias:

    Also, the Apache 2.0 docs for mod_redirect are at:


    Either way, you would do best to put these into the domain's vhost.conf and/or vhost_ssl.conf file(s), then run the Plesk reconfigure script:

    /usr/local/psa/admin/bin/websrvmng -u --vhost-name=domain.com

    Then restart the Apache service.

    Edit: Upon re-reading your initial post, I am not sure either Alias or Redirect would have any affect on your own PHP scripts though, since those get processed locally on the server, they don't come in from the client side as an Apache request.