Прескочи към главното съдържание

Configuring URL Rewriting - База знание / Legacy: Managing Deskpro On-Premise / Installation & Upgrades - Deskpro Support

Configuring URL Rewriting

Списък с автори

Deskpro takes advantage of URL rewriting to serve "clean" URLs to users. Without URL rewriting, your URLs will always have a "/index.php/" component in them. URL rewriting removes this, leaving you with a simpler and better looking URL.

You have to enable URL rewriting both in Deskpro and in your webserver for this to work.

In Deskpro:

1. Select Enable clean URLs under Admin > Server > Server Settings.

2. In config.php, check that this value is set to "true":

$DP_CONFIG['rewrite_urls'] = true;

 

The way to enable rewriting varies by webserver:

Apache: mod_rewrite

1. Enable the mod_rewrite module

If you are using Apache, you need to enable the mod_rewrite module.

 

For Ubuntu users, you can quickly enable mod_rewrite like this:

sudo a2enmod rewrite
sudo service apache2 restart

 

For CentOS/RHEL users, edit /etc/httpd/conf/httpd.conf and uncomment the mod_rewrite line. Then restart apache:

service apache2 restart

 

2. Enable .htaccess

Deskpro defines rewriting rules inside of the special .htaccess file. But you need to make sure .htaccess files are enabled for the directory you have installed Deskpro to. This is done by editing the Apache configuration and finding the <Directory> or <VirtualHost> section and ensuring AllowOverride is set to All.

 

For Ubuntu users installing Deskpro into the default web root, edit /etc/apache2/sites-available/default and find <Directory /var/www/> (or <Directory /var/www/html> for newer Ubuntu versions) and you will see AllowOverride is set to None by default. Just change the value to All and then restart apache.

 

For CentOS users installing Deskpro into the default web root, edit /etc/httpd/conf/httpd.conf and find <Directory "/var/www/html">. You will see AllowOverride is set to None by default. Just change the value to All and then restart apache.

 

nginx with php5-fpm

The easiest way to use nginx is by copying our example server configuration from this article: Using Deskpro With nginx

 

IIS

IIS users must install the URL Rewrite extension.

After installing the extension, URL rewriting should just work. Deskpro includes a web.config file with all of the relevant rewriting rules, and IIS should read this by default.

Полезно Не беше полезно

52 от 110 души смятат тази страница за полезна

Добави коментар

Моля, логнете се или се регистрирайте, за да оставите коментар.

Нуждаете се от подсещане за парола?