0

I have to configure my Apache2 server to host an old web application, based on Joomla 1.5. Apache is running on Debian Stretch, with PHP 7 as mod_php. I manage to install PHP 5.6 as FastCgi module and it looks like working as an alternative to PHP 7.

My VirtualHost looks like this:

<VirtualHost *:80>

  ServerName site.pl

  DocumentRoot /var/www/site/html
  DirectoryIndex index.html index.php

  <FilesMatch ".+\.ph(p[3457]?|t|tml)$">
        SetHandler "proxy:unix:/run/php/php5.6-fpm.sock|fcgi://localhost"
  </FilesMatch>

</Virtualhost>

And it works very well with basic urls, like:

http://site.pl/index.php

The problem is with other urls generated by this old CMS, like:

http://site.pl/index.php/category/page

I get 404 error, obviously.

I don't know how to keep this kind of urls and handle them with FastCgi proxy. What FileMatch cover this url? Any ideas?

1 Answers1

0

The argument in FilesMatch appears to be a regular expression, so you could adapt it to also match URLs generated by the old CMS, for example:

.+\.ph(p[3457]?|t|tml)(/.*)*$

Notice the (/.*)* at the end, which matches the additional path after index.php, but can be omitted, so that URLs without path are also matched.

david
  • 623
  • 5
  • 13