• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Clean URL drupal 7.4 plesk 12

JCV

New Pleskian
Hi.

My server is a debian 7 64 bits with plesk 12 last update.



A customer installed drupal 7.4 from plesk panel successful. However from Drupal/Configuration admin panel can not enable "Clean url". Clean test url failed too:

"The clean URL test failed"

.htaccess was ok .

I tried set domain vhost.con with (https://www.drupal.org/getting-started/clean-urls#enabling-7):
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
</IfModule>

But it not worked (IApache have module rewrite loaded.)

I think maybe issue y for nginx. But I don't know how set this ->https://www.drupal.org/node/976392 in nginx.conf of domain in plesk.

Anybody have can set clean url of Drupal in Plesk 12?

Thanks.
 
Below are the Nginx directives for Drupal:
Code:
# deny running scripts inside writable directories
location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
   return 403;
  error_page 403 /403_error.html;
}
   
# Support Clean (aka Search Engine Friendly) URLs
location / {
  rewrite ^/(.*)$ /index.php?q=$1;
}

# caching of files
location ~* \.(ico|pdf|flv)$ {
   expires 1y;
}

# Expire cache for images after 14 days
location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
   expires 14d;
}
 
Thanks abdi.

I tested with vhost_nginx.conf:

location @drupal {
rewrite ^(.*)$ /index.php?q=$1 last;
}

But it not worked.
 
I am not sure about what you used "@drupal" the much I know is:
Code:
[...]
location / {
rewrite ^/(.*)$ /index.php?q=$1;
}
[...]
 
I am not sure about what you used "@drupal" the much I know is:
Code:
[...]
location / {
rewrite ^/(.*)$ /index.php?q=$1;
}
[...]

Thanks abdi.

If I use without @drupal in vhost_nginx.conf an error appears because "location /" exits on nginx.conf (and this file can NOT MODIFY BECAUSE IT WAS GENERATED AUTOMATICALLY).
 

Attachments

  • nginx.png
    nginx.png
    51.6 KB · Views: 2
That's correct you can't have 2 lines of location / {.
In that case, just add the line below (in the already existent location / {)
Code:
rewrite ^/(.*)$ /index.php?q=$1;
 
If add from "extra nginx directives" in panel only the line:

rewrite ^/(.*)$ /index.php?q=$1;

I can save it, but when I load in my browser the domain it say: "Page not found". Then I must delete the line "rewrite ^/(.*)$ /index.php?q=$1;"

I will don't like modify the /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php because there are a lot lines with "location":

***************************************************************************************************************************
<?php if ($VAR->domain->physicalHosting->proxySettings['fileSharingPrefix']): ?>
location ~ ^/<?php echo $VAR->domain->physicalHosting->proxySettings['fileSharingPrefix'] ?>/ {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}
<?php endif; ?>

<?php endif; ?>

<?php if ($VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>

location @fallback {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}

<?php echo $VAR->includeTemplate('domain/service/nginxProtectedDirectories.php', $OPT); ?>

location ~ ^/(.*\.(<?php echo $VAR->domain->physicalHosting->proxySettings['nginxStaticExtensions'] ?>))$ {
try_files $uri @fallback;
}
<?php endif ?>

<?php if ($VAR->domain->physicalHosting->php && $VAR->domain->physicalHosting->proxySettings['nginxServePhp']): ?>

<?php if ($VAR->domain->physicalHosting->hasWebstat): ?>
location ~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon) {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}
<?php endif; ?>

location ~ ^/~(.+?)(/.*?\.php)(/.*)?$ {
alias <?php echo $VAR->domain->physicalHosting->webUsersDir ?>/$1/$2;
<?php echo $VAR->includeTemplate('domain/service/fpm.php'); ?>
}

location ~ ^/~(.+?)(/.*)?$ {
<?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT); ?>
}

<?php echo $VAR->includeTemplate('domain/service/nginxWordpress.php'); ?>

location ~ \.php(/.*)?$ {
<?php echo $VAR->includeTemplate('domain/service/fpm.php'); ?>
}

<?php echo $VAR->includeTemplate('domain/service/nginxWordpressIndexing.php'); ?>

location ~ /$ {
<?php echo $VAR->domain->physicalHosting->proxySettings['directoryIndex'] ?>
}

***************************************************************************************************************************
 
Back
Top