-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.htaccess
69 lines (61 loc) · 2.92 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Deny access to .php files inside the wp-content dir
# Mostly exploit/probe attempts, but these legitimate requests will be blocked:
# /wp-content/plugins/mobile-menu/vendor/titan-framework/lib/iframe-font-preview.php?...
# https://stackoverflow.com/a/47139015
RewriteCond %{REQUEST_URI} ^(.*/)?wp-content/.*\.php$
RewriteRule . /index.php [L]
# Avoid revealing information about core/plugin/theme directories
# https://github.com/ClassicPress/ClassicPress-Network/issues/6
RewriteCond %{REQUEST_URI} ^(.*/)?(wp-(content|includes)(/|$)|wp-admin/[^/]+(/|$))
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . /index.php [L]
# Staging only
Header set X-Robots-Tag "noindex,nofollow"
# Disable XMLRPC
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
# Disable cache
<IfModule LiteSpeed>
CacheDisable public /
</IfModule>
# BEGIN ClassicPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END ClassicPress
# BEGIN 301 Redirects
RedirectMatch 301 ^/blog/\d{4}/\d{1,2}/\d{1,2}/(.*)$ /blog/$1
RedirectMatch 301 ^/blog/can-i-use-the-classicpress-beta-on-live-website/? /blog/can-i-use-the-classicpress-beta-on-a-live-website-yes/
RedirectMatch 301 ^/blog/classicpress-for-business-professional-organization-websites/?$ /blog/why-choose-classicpress-for-your-business-professional-website-cms/
RedirectMatch 301 ^/blog/faqconc/how-to-revert-to-wp-498/?$ /faq/
RedirectMatch 301 ^/blog/tag/elementor-sticky/?$ /blog/
RedirectMatch 301 ^/classicpress-roadmap/?$ /roadmap/
RedirectMatch 301 ^/download/?$ /get-classicpress/
RedirectMatch 301 ^/get-involved/?$ /community/
RedirectMatch 301 ^/faqs/?$ /faq/
RedirectMatch 301 ^/migrate/?$ /get-classicpress/
RedirectMatch 301 ^/our-mission/?$ /about/
RedirectMatch 301 ^/translating-classicpress/?$ /blog/classicpress-localization/
RedirectMatch 301 ^/increase-your-plugin-audience-with-classicpress-users/?$ /for-plugin-developers/
RedirectMatch 301 ^/join-discord/?$ /community/
RedirectMatch 301 ^/blog/category/classicpress-blog/? /blog/
# END 301 Redirects
# BEGIN 302 Redirects
RedirectMatch 302 ^/latest\.json$ /wp-json/cp/v1/latest
RedirectMatch 302 ^/latest\.zip$ /wp-json/cp/v1/latest?format=zip
RedirectMatch 302 ^/latest\.tar\.gz$ /wp-json/cp/v1/latest?format=tar.gz
RedirectMatch 302 ^/latest-migration-plugin\.json$ /wp-json/cp/v1/latest?project=migration-plugin
RedirectMatch 302 ^/latest-migration-plugin\.zip$ /wp-json/cp/v1/latest?project=migration-plugin&format=zip
RedirectMatch 302 ^/blog/meet-the-community-patrick-klein/?$ /blog/meet-the-community-patrick-van-noort/
RedirectMatch 302 ^/version/([^/]*)/?$ https://github.com/ClassicPress/ClassicPress-release/releases/tag/$1
RedirectMatch 302 ^/shop/?$ /donate/#donate
RedirectMatch 302 ^/product/donate-to-classicpress/?$ /donate/#donate
RedirectMatch 302 ^/democracy/?$ /governance/
# END 302 Redirects