How to configure .htaccess in easyengine?


#1

I was install my php website in easyengine but some url have not found. The url have .html still normal but in case .php and etc having error. like this

https://www.stafaban.cf/collections/lirik-chord-1-800-273-8255-feat-alessia-cara-khalid-logic-torrent.php


#2

EasyEngine does not contain Apache. You need to learn how to use Nginx rules. You may use simple converter: http://labs.gidix.de/nginx/


#3

where i put the result code ?


#4

The settings for each site are stored in the folder /etc/nginx/sites-available . They include various default settings, which are typically sufficient for standard CMS and also custom rules that can be placed in the folder: /var/www/example.com/conf/nginx/


#5

But in your case you are just trying to use weird addresses for your website with PHP extension. EasyEngine first looks for a file with the PHP extension and if you can not find, gives a 404 error.


#6

So how to fix it ?


#7

You need to write your own rules for your CMS.


#8

If you created the site with easyengine like this:

ee site create stafaban.cf --php (or --mysql)

Then you might do this to make it work for your CMS:

ee site edit stafaban.cf

Now, remove the line

include common/php.conf;

and replace it with these lines

location / {
  try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
  try_files $uri $uri/ =404;
  include fastcgi_params;
  fastcgi_pass php;
}

Note: if you were using php7.0 then replace fastcgi_pass php; with fastcgi_pass php7;

Save with Ctrl+x then Y and test your siteā€¦


#9

Thanks


#10

So did you implement this? It does not seem to work for your original link https://www.stafaban.cf/collections/lirik-chord-1-800-273-8255-feat-alessia-cara-khalid-logic-torrent.php


#11