-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.htaccess
46 lines (33 loc) · 1.24 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
<IfModule mod_rewrite.c>
RewriteEngine On
#error control
ErrorDocument 404 /
#http to https
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#http to https
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#page rules
RewriteRule ^login$ login.php [NC,L]
RewriteRule ^registry$ registry.php [NC,L]
RewriteRule ^reset$ reset-password.php [NC,L]
RewriteRule ^write$ write.php [NC,L]
#categories rules
RewriteRule ^categories$ categories.php [NC,L]
RewriteRule ^categories/([a-zA-Z0-9-]+)$ categories.php?category_title=$1 [L,QSA]
#post rules
RewriteRule ^([0-9]+)-([a-zA-Z0-9-]+)$ post.php?post_id=$1&sef=$2 [L,QSA]
#user rules
RewriteRule ^user-option$ user-option.php [NC,L]
RewriteRule ^user/([^/]+)$ user.php?user_nick=$1 [L,QSA]
#contact rules
RewriteRule ^contact$ contact.php [NC,L]
#search rules
RewriteRule ^search$ search.php [NC,L]
#sitemap.xml rules
RewriteRule ^sitemap.xml$ sitemap.php [NC,L]
RewriteRule ^sitemap-([0-9]+)\.xml$ sitemap.php?parca=$1 [NC,L]
#robots.txt rules
RewriteRule ^robots.txt$ robots.php [NC,L]
</IfModule>