forked from ClassicPress/site-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
48 lines (41 loc) · 1.88 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
RewriteEngine On
# Deny access to files like .env and Composer in a way that does not reveal
# their existence (pass off to ClassicPress for 404 generation)
RewriteCond %{REQUEST_FILENAME} /\.env(\.example)?$ [OR]
RewriteCond %{REQUEST_URI} ^/composer\. [OR]
RewriteCond %{REQUEST_URI} ^/vendor(/|\?|$) [OR]
RewriteCond %{REQUEST_URI} ^/\.git [OR]
RewriteCond %{REQUEST_URI} ^/README.md
RewriteRule . /index.php [L]
# Deny access to .php files inside the wp-content dir
# Mostly exploit/probe attempts
# 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]
# 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 ^/press-and-branding/?$ https://www.classicpress.net/brand-guidelines/
# END 301 Redirects
# BEGIN 302 Redirects
RedirectMatch 302 ^/browser-support/?$ /user-guides/browser-support/
RedirectMatch 302 ^/installing-classicpress/installing-with-composer/?$ /developer-guides/installing-with-composer/
RedirectMatch 302 ^/installing-classicpress/?$ /user-guides/installing-classicpress/
RedirectMatch 302 ^/updating-classicpress/?$ /user-guides/updating-classicpress/
RedirectMatch 302 ^/faq-and-support/?$ /user-guides/faq-and-support/
RedirectMatch 302 ^/using-classicpress/custom-login-image/?$ /user-guides/custom-login-image/
RedirectMatch 302 ^/developing-classicpress/security-page/?$ /developer-guides/security-page/
# END 302 Redirects