开发者

Unable to ignore a directory in WordPress install via .htaccess

开发者 https://www.devze.com 2023-03-26 05:57 出处:网络
/custom/player-registration.php I\'ve used the following .htaccess in my WordPress install and I can\'t access the above URL... any tips?I\'ve tried 2 methods here...The URL continues to go to a Wor
/custom/player-registration.php

I've used the following .htaccess in my WordPress install and I can't access the above URL... any tips? I've tried 2 methods here... The URL continues to go to a WordPress search page.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^custom - [L,NC]
RewriteCond %{REQUEST_URI} !^/(custom|custom/.*)$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

UPDATE

I suppose I need to clarify that I am able 开发者_JAVA百科to access /custom but am NOT able to access files within that directory... how do I access files within that directory?


Default WP .htaccess:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

means: if request doesn't point to any existing file or directory, use index.php

So it should serve Your file well with default settings. What are You trying to acomplish with the rest of Your file?


Try

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^custom.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
0

精彩评论

暂无评论...
验证码 换一张
取 消