Modules
Hide xFields
Free
Version: 1.0
Author: Elkhan I. Isaev
Tags: #DLE, #DLEModule, #DataLifeEngine
Hack installation:
- Download and install the file hide-xfields-from-url.xml in the Engine Control Panel's External Plugins Management:
- Specify rules (above category rules):
NGINX (nginx.conf -> server -> location):
Find:
rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
rewrite "^/([^.]+)(/?)+$" /index.php?do=cat&category=$1 last;
Insert above:
location / {
rewrite "^/(.*[\.]+.*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
rewrite "^/(.*[\.]+.*)/?$" /index.php?do=xfsearch&xf=$1 last;
}
Or if you are using APACHE2, find the file (.htaccess) in the root of your site Attention! Before modifying the file, be sure to save a copy:
Find:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2 [L]
Insert above:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[\.]+.*)/page/([0-9]+)(/?)+$ index.php?do=xfsearch&xf=$1&cstart=$2 [L]
RewriteRule ^(.*[\.]+.*)/([^/]*)(/?)+$ index.php?do=xfsearch&xf=$1 [L]
- Remove redirects from .htaccess related to xfsearch
RewriteRule ^xfsearch/(.*)/page/([0-9]+)(/?)+$ index.php?do=xfsearch&xf=$1&cstart=$2 [B,L]
RewriteRule ^xfsearch/(.*)/?$ index.php?do=xfsearch&xf=$1 [B,L]
- Introduce redirection for old xfsearch (for example, to the main page)
Find:
RewriteRule ^page/([0-9]+)(/?)$ index.php?cstart=$1 [L]
Insert above:
RewriteRule ^xfsearch/(.*)$ / [R=301,L]
or to a new page:
RewriteRule ^xfsearch/(.*)$ /$1 [R=301,L]
Add redirects to ensure that xfsearch works for values with dots. All new cross additional fields will work and will not require adding a rule to .htaccess.
Общий рейтинг: 4
Всего оставлено 0 комментариевDataLife Engine: 14+