" ... Add virtual host config file /etc/apache2/sites-enabled/yoursite.conf. Assuming Plone is your site id in Zope Management Interface (capital lettering do matter) and your domain name is yoursite.com ...."
to no avail.
I have previously run my plone production on CentOS/Plesk/Apache the plone rewrite rule worked with no problem. Has anyone seen the same problem?
I've never seen anyone use the .htaccess file that way. A more typical file in which to put rewrite rules for Apache would be called /etc/apache2/sites-enabled/openbeam.net.conf but it will depend on your system.
I have put the plone rewrite code /etc/apache2/sites-enabled/openbeam.net.conf there as well. It didn't work.
In fact, even when I put the following code :
UseCanonicalName On
NameVirtualHost *
<VirtualHost *>
ServerAlias openbeam.net
ServerSignature On
Header set X-Frame-Options "SAMEORIGIN"
Header set Strict-Transport-Security "max-age=15768000; includeSubDomains"
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set Content-Security-Policy-Report-Only "default-src 'self'; img-src *; style-src 'unsafe-inline'; script-src 'unsafe-inline' 'unsafe-eval'"
ProxyVia On
# prevent your web server from being used as global HTTP proxy
<LocationMatch "^[^/]">
Deny from all
</LocationMatch>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# The following code works if I put in /var/www/vhosts/openbeam.net/httpdocs/.htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^openbeam.net [OR]
RewriteCond %{HTTP_HOST} ^www.openbeam.net
RewriteRule ^(.*) http://falcon296.startdedicated.com:8084/openbeam
<VirtualHost *>
ServerAlias *
ServerRoot /var/www
ServerSignature On
What I stumbled upon is that for unknown reason, my Apache2 config is such that
the RewriteRule ^/(.) pattern does not fire the rewrite . When I replaced it with ^(.) ie, the "/" has been elimiated then the pattern will trigger.
By doing that a url like: http://openbeam.net/beamprojects and http://openbeam.net/infocenter get properly redirected without explosing the long url. However, the rewrite pattern is such that openbeam.org and its Home tab is not referencing the right place. I need to figure out a rewrite rule for the case when there is no child.
And also I have absolutely no idea why my Rewrite engine works differently.
It turns out for my Plesk, Debian, Apache2 configuration, I had to put my rewrite rule in
/var/www/vhosts/system/xxx/conf/httpd.conf file. This file was initially generated by Plesk admin console when I add a doman or subdomain via Plesk. /etc/apache2/sites-enabled/xxx.conf has no effect on my system. I cannot explain why. All I know is that it works.