在root上的Wordpress .htaccess文件创建子目录的问题

时间:2014-04-29 10:29:04

标签: php wordpress apache .htaccess mod-rewrite

我有一个非常关键的Wordpress问题弄乱了我的网站的子目录。以下是非常详细的信息。

  1. 我在root上安装了wordpress。不幸的是,我无法将其移动到文件夹中。
  2. 我在以下3个目录中有3个其他自定义PHP应用程序

    一个。 /客户端

    湾/ console

    ℃。 / order

  3. 以下是每个目录的.htaccess代码

    。/ client文件夹的.htaccess代码

    # This Directive will make Apache look first  
    # for "index_good.html" before looking for "index.html"  
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^orders$ orders.php
    RewriteRule ^profile$ profile.php
    RewriteRule ^orders/pending$ orders.php?type=pending
    RewriteRule ^orders/completed$ orders.php?type=completed
    RewriteRule ^logincheck$ logincheck.php
    RewriteRule ^login$ login.php
    RewriteRule ^logout$ logout.php
    RewriteRule ^ticket/open$ support-ticket-open.php
    RewriteRule ^ticket/open/step/2$ support-ticket-open-2.php
    
    
    
    RewriteRule ^order/view/(\w+)$ show-order-details.php?id=$1 [L]
    

    .htaccess / console 文件夹

    # This Directive will make Apache look first  
    # for "index_good.html" before looking for "index.html"  
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^orders$ orders.php
    RewriteRule ^services$ services.php
    RewriteRule ^service/add$ add-service.php
    RewriteRule ^coupons$ coupons.php
    RewriteRule ^markups$ markups.php
    RewriteRule ^markups/view/maincat$ markups.php?view=maincat
    RewriteRule ^markups/view/markup$ markups.php?view=markup
    RewriteRule ^markups/view/option$ markups.php?view=option
    RewriteRule ^order/add/step/(\w+)$ add-order.php?step=$1
    RewriteRule ^order/add$ add-order.php
    RewriteRule ^client/add$ add-client.php
    RewriteRule ^clients$ clients.php
    RewriteRule ^logout$ logout.php
    RewriteRule ^login$ login.php
    RewriteRule ^ordering/service$ service-ordering.php
    RewriteRule ^ordering/markup$ markup-ordering.php
    RewriteRule ^setting/markup$ markup-setting.php
    RewriteRule ^setting/general$ general-settings.php
    RewriteRule ^tickets$ tickets.php
    RewriteRule ^ticket/open$ open-ticket.php
    
    
    
    
    RewriteRule ^order/view/(\w+)$ show-order-details.php?id=$1 [L]
    RewriteRule ^client/orders/(\w+)$ orders.php?client_id=$1 [L]
    RewriteRule ^ticket/update/([\w-]+)$ update-ticket.php?ticket_no=$1 [L]
    

    .htaccess for order folder

    # This Directive will make Apache look first  
    # for "index_good.html" before looking for "index.html"  
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^order$ order.php
    RewriteRule ^order/([^/\.]+)/$ order.php?service=$1
    RewriteRule ^order/view/(\w+)$ show-order-details.php?id=$1 [L]
    

    .htaccess for Wordpress

    # 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>
    
    # END WordPress
    

    现在的问题是所有/客户&amp; / console文件夹可以正常访问。但我有一个名为/ server / php / inside / order文件夹的文件夹。此文件夹似乎无法访问,并重定向到Wordpress 404页面。我一直在努力。但是,一切都是徒劳的。请知道问题所在。另外,我无法将Wordpress移动到/ wp文件夹。所以,请相应的建议。

    提前致谢!

1 个答案:

答案 0 :(得分:0)

我曾经有过像这样的问题,我在一个子目录中有一个带有wordpress ass root的cakephp应用程序,编辑你的wordpress htaccess看起来像这样

#Action php /cgi-php52/php
#AddHandler php52 .php

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

 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_URI} !^/(order/server/php/|order/server/php/.*)$
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
</IfModule>
# END WordPress

这基本上是告诉它忽略指向文件夹客户端,控制台和命令的URL的重写条件