admin管理员组文章数量:1122833
I'm trying to find the full path of my 404.php file. I thought it would be like this:
ErrorDocument 404 /index.php?error=404
The reason for this is because I am trying to redirect non-IP permitted people to 404.php page using the .htaccess rule (written below)
My WordPress is at the root level of the domain. 404.php doesn't load however...
Here is the .htaccess rule I have tried to get working:
ErrorDocument 401 /index.php?error=404 ErrorDocument 403 /index.php?error=404
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR] RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^IP Address One$
RewriteCond %{REMOTE_ADDR} !^IP Address Two$
RewriteCond %{REMOTE_ADDR} !^IP Address Three$ RewriteRule ^(.*)$ -
[R=403,L] </IfModule>
I'm trying to find the full path of my 404.php file. I thought it would be like this:
ErrorDocument 404 /index.php?error=404
The reason for this is because I am trying to redirect non-IP permitted people to 404.php page using the .htaccess rule (written below)
My WordPress is at the root level of the domain. 404.php doesn't load however...
Here is the .htaccess rule I have tried to get working:
ErrorDocument 401 /index.php?error=404 ErrorDocument 403 /index.php?error=404
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR] RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
RewriteCond %{REMOTE_ADDR} !^IP Address One$
RewriteCond %{REMOTE_ADDR} !^IP Address Two$
RewriteCond %{REMOTE_ADDR} !^IP Address Three$ RewriteRule ^(.*)$ -
[R=403,L] </IfModule>
Share
Improve this question
asked Aug 17, 2017 at 13:59
HenryHenry
9831 gold badge8 silver badges31 bronze badges
2
|
1 Answer
Reset to default 0I just made it a full URL Path so https://example.com/404.php
and that works great....kinda obvious - and I wonder if that is 'not the WordPress way'
本文标签: htaccessUnable to find 39fullpath39 to my 404php file
版权声明:本文标题:htaccess - Unable to find 'full-path' to my 404.php file 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736291030a1928638.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
[R=404]
) if that is the intention? – MrWhite Commented Aug 18, 2017 at 14:40