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

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

报告相同问题?

悬赏问题

  • ¥15 欧拉系统opt目录空间使用100%
  • ¥15 ul做导航栏格式不对怎么改?
  • ¥20 用户端如何上传图片到服务器和数据库里
  • ¥15 现在研究生在烦开题,看了一些文献,但不知道自己要做什么,求指导。
  • ¥30 vivado封装时总是显示缺少一个dcp文件
  • ¥100 pxe uefi启动 tinycore
  • ¥15 我pycharm运行jupyter时出现Jupyter server process exited with code 1,然后打开cmd显示如下
  • ¥15 可否使用carsim-simulink进行四轮独立转向汽车的联合仿真,实现四轮独立转向汽车原地旋转、斜向形式、横移等动作,如果可以的话在carsim中如何进行相应设置
  • ¥15 Caché 2016 在Java环境通过jdbc 执行sql报Parameter list mismatch错误,但是同样的sql使用连接工具可以查询出数据
  • ¥15 疾病的获得与年龄是否有关