两个.htaccess两个站点


Two .htaccess Two Sites

我有一个自定义电子商务网站,其中有一个.htaccess文件。我现在正在用Wordpress为它创建一个博客,并将其安装在名为blog的子目录中。

一切都很好,直到我登录到Wordpress管理面板并将永久链接结构更改为%postname%。修改后,登录页面和.htaccess为空。

我需要有人的帮助来审查我的.htacess文件,并做出改变,使允许Wordpress永久链接结构,并确保它不与主站冲突。如果我添加Wordpress .htaccess代码到根.htaccess在底部,然后博客工作正常,但主站得到一个404错误。

根. htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^Home index.php
RewriteRule ^CompanyProfile about.php
RewriteRule ^ContactUs contact.php
RewriteRule ^Shopping-Basket inq.php
RewriteRule ^My-Account myacc.php
RewriteRule ^SiteMap sitemap.php
RewriteRule ^Terms-Conditions terms.php
RewriteRule ^Privacy-Policy privacy.php
RewriteRule ^Delivery-Information delivery.php
RewriteRule ^Returns-Policy returns.php
RewriteRule ^Disclaimer disclaimer.php
RewriteRule ^Clients clients.php
RewriteRule ^Search-Results result.php
RewriteRule ^Do-Login dologin.php
RewriteRule ^Member-Login login.php
RewriteRule ^Logout logout.php
RewriteRule ^Delete/([a-zA-Z0-9_-]+)$ delp.php?id=$1
RewriteRule ^Shopping-Basket/([a-zA-Z0-9_-]+)$ inq.php?msg=$1
RewriteRule ^ForgetPassword/([a-zA-Z0-9_-]+)$ forget.php?msg=$1
RewriteRule ^ForgetPassword forget.php
RewriteRule ^Checkout checkout.php
RewriteRule ^OrderStatus status.php
RewriteRule ^ChangePassword changepassword.php
RewriteRule ^CreateAccount/([a-zA-Z0-9_-]+)$ create.php?msg=$1
RewriteRule ^CreateAccount create.php
RewriteRule ^ChangeAccount chgaccount.php
RewriteRule ^Shipping shipping.php
RewriteRule ^SaveLogin savelogin.php
RewriteRule ^SaveOrder saveorder.php
RewriteRule ^sections/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ cproducts.php?SID=$2&MID=$1
RewriteRule ^bproducts/([a-zA-Z0-9_-]+)$ products.php?MID=$1
RewriteRule ^productdetail/([a-zA-Z0-9_-]+)$ prod_detail.php?PID=$1
RewriteRule ^products/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ bproducts.php?SID=$2&MID=$1
RewriteRule ^Details/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ large.php?PID=$3&SID=$2&MID=$1
RewriteCond %{HTTP_HOST} !^www.mydomain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 [L,R=301

子目录/blog .htaccess:

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