douaoli5328
2015-12-11 01:21
浏览 24
已采纳

在同一个ftp服务器上使用非wordpress PHP页面

I have Wordpress site set up on the route of my ftp server, I am trying to add PressKit() to my site in the directory /Press . This uses an index.php file to display the html, however wordpress seems to show a 404 error when trying to access it. I have tried adding a .htaccess to the subdirectory, but with no luck.

I'm wondering how to prevent the 404 error from displaying? As I am certain the page is there, as a few times when I use the full url (including index.php) it will open, but only on my machine.

Apologies if this is simple, web dev isn't really my field.

Cheers.

Edit: Works now, but case sensitive

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI}  !(Press) [NC]

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

图片转代码服务由CSDN问答提供 功能建议

我在我的ftp服务器的路由上设置了Wordpress网站,我试图添加 PressKit()到我的网站目录/按。 这使用index.php文件来显示html,但是在尝试访问时,wordpress似乎显示404错误。 我已经尝试将.htaccess添加到子目录中,但没有运气。

我想知道如何防止显示404错误? 我确信页面在那里,有几次当我使用完整的URL(包括index.php)时,它会打开,但只能在我的机器上打开。

道歉,如果这是 简单,web dev不是真正的我的领域。

干杯。

编辑:现在可以使用,但区分大小写 \ n

  #BEGIN WordPress 
RewriteEngine On 
RewriteBase / 
RewriteRule ^ index.php $  -  [L] 
 
#在下一行中包含要排除的所有文件夹
RewriteCond%{REQUEST_URI}!(按 )[NC] 
 
RewriteCond%{REQUEST_FILENAME}!-f 
RewriteCond%{REQUEST_FILENAME}!-d 
RewriteRule。  /index.php [L] 
 #END WordPress 
   
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • doushi4795 2015-12-11 02:34
    最佳回答

    Open the .htaccess file, in the root of your WordPress installation (not the sub-folder), and look for the #BEGIN WORDPRESS block. You can replace it with this

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    
    # Include in the next line all folders to exclude
    RewriteCond %{REQUEST_URI}  !(Press|folder2) [NC]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress 
    

    You can add more folders for WordPress to ignore, using the pipe | where you currently see the words Press|folder2. You may also remove the "folder2" reference, that's just an example

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题