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 
  • 写回答

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程