Since version 220.127.116.11 we've gradually moved all the custom files (like templates, banner images and other uploaded files) from /accounts/default1 directory to the database of the software. Main reason for this move was to meet the requirements for our cloud infrastructure where all the hosted with us monthly accounts run the same files and the only difference per different customers is their database.
For self-hosted customers this move brings easier way of moving their installation from location to location since you don't need the original files and will manage only with the database and a new installation archive.
To maintain backward compatibility, so that your affiliates do not need to change the banners they have already published, we couldn't change the original URLs of these custom files which were at .../accounts/default1/... to the new URL which is .../scripts/file.php?file=..., therefore we've added new mod_rewrite rules to .htaccess file of your installation.
This means that the software now requires mod_rewrite to be running properly on your server and executing the mod_rewrite rules, this requirement is also checked when the software is installed anew or when you upgrade to newer version.
There are 3 general scenarios which the mod_rewrite check can produce:
- Everything works as expected and you can continue with installation or upgrade.
- The installation was able to run the .htaccess test and it found out that the rewrite rules do not work. You will need to investigate why exactly the .htaccess rules do not work, maybe you didn't correctly configure the rewrite rules on your server type, maybe you don't have mod_rewrite support added to your Apache server or maybe there is some different problem. You can read further to find out how the system checks the rewrite rules so you could run the check by yourself while trying to troubleshoot the problem.
- The installation wasn't able to run the .htaccess test and therefore it isn't able to determine whether the rewrite rules work or not and you need to test this by yourself before continuing with the installation.
The .htaccess/mod_rewrite check can be done by simply calling URLs which should be rewritten and see if they show the same results as the URLs to which they should be rewritten.
Let's say you have your PAP installed at URL http://www.domain.com/folder/
- you start the test by opening URL address of a non-existing banner image in your browser e.g. http://www.domain.com/folder/accounts/default1/banners/NotExistingImage.jpg
- the mod_rewrite functionality as defined in the .htaccess file in the root of your PAP installation is responsible for rewriting this URL to http://www.domain.com/folder/scripts/file.php?file=banners/NotExistingImage.jpg
Therefore when you open these URLs you should see the same result on both which should be a 1 x 1 image pixel with a response code 200 OK. If you see 404 Not found on the first URL then your mod_rewrite functionality is not working.
If the system couldn't test the mod_rewrite functionality by itself then after you are 100% sure that the rewrite functionality works correctly you can click Next on the requirements screen on the upgrade/installation screen, it should let you proceed. Please keep in mind that the working mod_rewrite functionality is a software requirement without which it will not work correctly so if you should proceed with upgrade/installation with the rewrite functionality not working then you will not be able to edit your template files, upload new banners images and you can encounter many other problems.
If the system could test the mod_rewrite functionality by itself and it found out that the mod_rewrite functionality doesn't work then it will not let you proceed with the upgrade/installation until you fix the problem.
Most common problems why the mod_rewrite does not work:
1. NGINX configuration added with incorrect locations
The configuration described at the NGINX installation guide is an example only and therefore it has to be rewritten with your specific installation, server paths and settings in mind, it cannot be simply copy and pasted, maybe you will need to define the locations differently.
2. Apache mod_rewrite module not installed on your server at all.
3. AllowOverride not defined with Apache in php.ini or under virtual hosts folder
Sometimes even though mod_rewrite is enabled and installed on your server the .htaccess rewrite rules still do not work. In most cases the solution was to add AllowOverride All directive to your php.ini file and restart the server. If you are using virtual hosts you will need to add this directive into a .conf file in the /sites-enabled/ or /sites-available/ folders in Apache configuration e.g. under /etc/apache/sites-available/default, the AllowOverride All will have to be added inside a <Directory> block of the configuration file, so the whole block can look for example like this:
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>