This article details how to fix a malfunctioning "Site Preview" button.
The Plesk control panel has a function to preview the site URL, before you change your DNS to the server (it's a useful tool from time to time).
To get to the preview tool, you would normally do:
- Login to your Plesk Control Panel
- Click on "Domains" and then click on the domain you wish to preview
- Click on "Site Preview" and that should show the site on the Plesk Server.
Sometimes, there are problems with it, and you end up seeing a Error 404 (Page not found). In this case, you may do the following to resolve this issue. Please note, that this is a fix via Shell, and that you should know a little about shell before you venture into it.
Here is the fix:
- Login to your Plesk server using the username "root" and the password for your Plesk administrative access.
- Next, you will need to run the following command (this is using a editor called "vi"):
# vi /usr/local/psa/admin/conf/httpsd.conf
- Near the end of the file section marked "<VirtualHost _default_:8880>" add the following items:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/sitepreview/(.{0,})$
RewriteRule ^/sitepreview/(.{0,})$ /sitepreview.php?$1 [L] - Next, we need to "save" the file, and then restart Plesk. You may restart Plesk, by doing the following:
# /etc/init.d/psa restart
Well done, that should have resolved the Site Preview problem that you may have experienced.