Redirection

webling

Member
Does anyone have experience with mod_rewrite or would I use another approach to this?

I want to make anyvirtualhost.com/menu forward to anyvirtualhost:8880

This is so clients don't have to use the URL Plesk sets up and can simply type /menu after their hostname to login to the control panel.

To my knowledge, Plesk or Virtuozzo don't have any configuration for this and so it would need to be done in the httpd.conf file.

Would adding an alias accomplish this such as: Alias /menu/ ":8880"
 
Last edited:
I don't think mod rewrite is what you need.

I think you need a ProxyPass and ProxyPassReverse in your vhost to do this!
 
I don't think mod rewrite is what you need.

I think you need a ProxyPass and ProxyPassReverse in your vhost to do this!

This does appear to be the solution. However, editing directly to the httpd.conf file can cause Plesk to not work properly and also the domain can disappear. I had to remove the code and any spacing I added and the domain came back.
 
With plesk you must create a vhost.conf in the conf directory of the domain.

/var/www/vhosts/<domain>/conf/vhost.conf

Anything in here overides the httpd.conf

Plesk does not automatically find these vhost.conf files so the run the following command

/usr/local/psa/admin/bin/websrvmng -av

Once plesk has picked the vhost.conf file up you shouldn't have to call the script again when you edit it, just merely restart apache gracefully.

I hope this helps!
 
I'm considering adding an alias to the vhost configuration file and popping an htaccess file into the directory so when any vhost on my server goes to somedomain.com/menu it will take them to the login page for their control panel. I think this would be an easier task.
 
You could create a file called menu.conf in /etc/httpd/conf.d

That would contain something along the line of

Alias /menu "/var/www/menu"

in /var/www/menu you place your .htaccess file
 
Last edited:
You could create a file called menu.conf in /etc/httpd/conf.d

That would contain something along the line of

Alias /menu "/var/www/menu"

in /var/www/menu you place your .htaccess file

Here's an idea also, this way I wouldn't have to write an htaccess file. Would it be possible to create a vhost.conf for each domain in
/var/www/vhosts/thedomain.com/conf/vhost.conf

and then simply add the alias there without having to use an htaccess file? Such as this...

Alias /menu /path/to/the/control/panel

It seems to me that would be easier even though it would have to be configured for each domain.
 
If you did what I had previously stated it would apply to ALL domains!
 
Last edited:
Back
Top