• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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