• 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.

SSL / Mod_rewrite / php gone wrong

N

northernpaul

Guest
Hi,

I'm struggling with a bit of an odd problem, hope someone will be able to point me in the right direction for help...

I've set up a website that uses mod_rewrite to redirect all php and html requests under the domain to a single file:

RewriteEngine on
RewriteOptions MaxRedirects=10
RewriteRule !\.(js|ico|gif|jpg|png|css|pl|z5m|swf|mp3)$ /upfMain.php

...and it works, as long as you are requesting a page using http://www.whatever.com/page.

However, some pages need to be secure, i.e. called using https://www.whatever.com/page, and at this point things go wrong. The SSL cert is installed correctly, and set in the admin to use a single directory for both SSL and non-SSL content, but when you try to view a page that normally works, mod_rewrite does nothing and some pages don't parse the PHP, although that may just be an odd side effect of the mod_rewrite failing.

Any help would be gratefully appreciated,

Paul
 
Don't worry - found it:)

Had put mod_rewrite rules in vhost.conf in the conf directory of the domain, needed to create a file called vhost_ssl.conf in the same directory, duplicate the rules from vhost.conf and run /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com, then finally restart apache and it works.
 
Back
Top