This repository has been archived by the owner on Mar 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.htaccess
48 lines (40 loc) · 1.78 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#Custom Status Error page
ErrorDocument 404 /pages/error/404.php
#URL rewriter
AddDefaultCharset UTF-8
Options +FollowSymlinks
RewriteEngine On
#do not perform rewrite in the following directory
RewriteRule ^includes - [L,NC]
RewriteRule ^views - [L,NC]
RewriteRule ^forum - [L,NC]
RewriteRule ^pages - [L,NC]
RewriteRule ^tasks - [L,NC]
RewriteRule ^sqlbuddy - [L,NC] #only for dev purpose
#if requested opensearch.xml load opensearch.php file
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.xml $1.php [L]
#if the requested file has a .php or .php/ ending then remove it
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php [OR]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php/
RewriteRule ^(.*)\.php /$1/ [R=301,L]
#if the requested file is not valid then add a .php extension and look for it and load it
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
#if the url have addon in it and have 1 or 2 query then fireup this custom rewrite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^addons/([A-Яа-я0-9-]+)/([\w]+)/(.*?)/$ addons.php?type=$1&id=$2&title=$3 [L,NE]
RewriteRule ^addons/([A-Яа-я0-9-]+)/(.*?)/$ addons.php?id=$1&title=$2 [L,NE]
RewriteRule ^addons/([A-Яа-я0-9-]+)/$ addons.php?id=$1 [L,NE]
RewriteRule ^help/([\w-]+)/$ help.php?$1 [L]
RewriteRule ^api/([\w.]+)/$ api.get.php?v=$1 [L]
#old website to new website link redirect
Redirect 301 /download.html /downloads
Redirect 301 /help.html /help/faq
Redirect 301 /release_notes.html /help/release-note
Redirect 301 /features.html /#simple_powerful