Skip to content

Instantly share code, notes, and snippets.

@Rijen
Created April 18, 2017 07:07
Show Gist options
  • Save Rijen/5be27996a95dfaea3fd7254dae628ca1 to your computer and use it in GitHub Desktop.
Save Rijen/5be27996a95dfaea3fd7254dae628ca1 to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
# перенаправление с без_www на www
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteCond %{HTTP_HOST} ^(.+)$
#RewriteRule (.*) http://www.%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^pkbct.ru.ru$ [NC]
RewriteRule ^(.*)$ http://www.pkbct.ru/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^mysql.php$ index.php [L]
RewriteRule ^wp-content/images/thumb_cache/(.*)$ upload/images/thumb_cache/$1 [L]
RewriteRule ^wp-content/uploads/(.*)$ upload/$1 [L]
RewriteRule ^themes/sample/images/(.*)$ themes/sample/pics/images/$1 [L]
RewriteRule ^pictures/(.*)$ themes/sample/pics/pictures/$1 [L]
RewriteRule ^images/(.*)$ themes/sample/pics/images/$1 [L]
RewriteRule ^js/(.*)$ themes/sample/js/$1 [L]
RewriteRule ^css/(.*)$ themes/sample/css/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+[^/])$ /$1/ [R=301,L]
RewriteRule ^api/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/$ api/index.php?p=$1&d=$2&f=$3&k=$4&a=$5&p1=$6&d1=$7 [L]
RewriteRule ^admin/(.+[^/])$ /$1/ [R=301,L]
RewriteRule ^admin/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/$ index.php?theme=admin&p=$1&d=$2&f=$3&k=$4&a=$5&p1=$6&d1=$7 [L]
RewriteRule ^favicon.ico$ favicon.ico [L]
RewriteRule ^([^/]+)/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/?([^/]+)?/$ index.php?p=$1&d=$2&f=$3&k=$4&a=$5&p1=$6&d1=$7&%{QUERY_STRING} [L]
</ifModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment