• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Redirect subdirectory

N

networkthinking

Guest
Hello,
We havea site that needs to redirected due to some existing code. The current code uses:
http://www.abc.com/company1/index.html

The directory structure though is:
www.abc.com/site1/company1/index.html

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?

/httpdocs/site1/company1

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

Thanks,
Wally
 
Or you could try using mod_alias:

http://httpd.apache.org/docs/2.0/mod/mod_alias.html#alias
The Alias directive allows documents to be stored in the local filesystem other than under the DocumentRoot. URLs with a (%-decoded) path beginning with url-path will be mapped to local files beginning with directory-path.
Example:

Alias /company1 /site1/company1

Syntax: Alias URL-path file-path|directory-path
Also, the Apache 2.0 docs for mod_redirect are at:

http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect

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.
 
Back
Top