WordPress的永久链接和常规的PHP文件

我有Wordpress安装在根目录,并正确configuration使用永久链接。

除了WordPress的博客,我还有一个完整的自定义开发的PHP应用程序与几个页面。 我想不显示任何自定义页面的.php扩展名,但我现在得到所有的自定义PHP页面的404错误。

http:// url / blog-title-here (单词新闻页面 – 作品)

http:// url / register (自定义php页面 – 结果在404)

以下是我的.htaccess的样子:

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 

这里是我在httpd.conf中的

 <Directory /> Options FollowSymLinks AllowOverride All RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*) $1.php [L] </Directory> 

方法1:

https://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess

方法2:

 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # each script write like this RewriteRule ^register$ register.php [QSA,L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>