Drupal 7 - The clean URL test failed.

Questions about hosting a Website, using MySQL, PhP or MariaDB may be posted here.
Forum rules
Synology Community is the new platform for the enthusiasts' interaction, and it will soon be available to replace the Forum.
hktomywu
I'm New!
I'm New!
Posts: 2
Joined: Tue Mar 13, 2018 5:01 pm

Drupal 7 - The clean URL test failed.

Unread post by hktomywu » Tue Mar 13, 2018 5:11 pm

I cannot enable clean URL on my Synology DS216+II for my Drupal website.

Here is my setting:
- DSM 6.1.5-15254 Update 1
- nginx
- PHP 5.6
- drupal 7.6 with multi sites

I came across a lot of articles on apache - modifying .htaccess file but seems not applied for nginx server.
I tried to modify /etc/nginx/app.d/server.webstation-vhost.conf but it revert back everytime after reboot.

My other Word Press website on the same server cannot use clean URL also.

Please help.

Ralphort
Trainee
Trainee
Posts: 11
Joined: Mon Jan 20, 2014 4:14 pm

Re: Drupal 7 - The clean URL test failed.

Unread post by Ralphort » Sun Mar 18, 2018 4:32 pm

hktomywu wrote:I cannot enable clean URL on my Synology DS216+II for my Drupal website.

Here is my setting:
- DSM 6.1.5-15254 Update 1
- nginx
- PHP 5.6
- drupal 7.6 with multi sites

I came across a lot of articles on apache - modifying .htaccess file but seems not applied for nginx server.
I tried to modify /etc/nginx/app.d/server.webstation-vhost.conf but it revert back everytime after reboot.

My other Word Press website on the same server cannot use clean URL also.

Please help.
Had similar experience before. Also did some changes only to see it back on default after reboot. Nginx doesn't use .htaccess so it's useless modifying it. The only way for me get the drupal site to have a clean url is to run it on virtual host & wordpress without virtual host. It's easy to get rid of the .../wordpress/index.php on wordpress with online tutorials. As far as clean url on wordpress, I only managed to get as far default (plain) if I remembered it correctly on permalink settings without breaking the url link.

hktomywu
I'm New!
I'm New!
Posts: 2
Joined: Tue Mar 13, 2018 5:01 pm

Re: Drupal 7 - The clean URL test failed.

Unread post by hktomywu » Sun Mar 18, 2018 4:50 pm

I finally sorted it out. Below is the solution:

Take a look at the content of/etc/nginx/app.d/server.webstation-vhost.conf, to see where the custom configuration has to be stored:
server {
[...]
server_name NAME
[...]

include /usr/local/etc/nginx/conf.d/778943ad-0dc4-40ae-bb7f-7b2285e3203b/user.conf*;
}
Then, you just have to create the file /usr/local/etc/nginx/conf.d/778943ad-0dc4-40ae-bb7f-7b2285e3203b/user.conf.wordpress-permalink with the following content:
location /{
try_files $uri $uri/ /index.php?$args;
}
and restart nginx:
synoservicecfg --restart nginx
It will not break the future DSM update (since it is a supported customization)

Post Reply

Return to “Web Server + PHP / MySQL + MariaDB”