Two .htaccess Two Sites

I have a custom ecommerce site which have one .htaccess file. I am now creating a blog for it using WordPress, and installed it in a subdirectory named blog.

Everything was fine until I logged in to the WordPress admin panel and changed the permalink structure to %postname%. After I changed it, the login page and the .htaccess was empty.

Read More

I need help from someone to review both my .htacess files and make changes which make allow the WordPress permalink structure and make sure it doesn’t conflict with the main site. If i add the WordPress .htaccess code into the root .htaccess at the bottom, then the blog works fine but the main site gets a 404 error.

Root .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

Sub-directory /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>

Related posts

Leave a Reply

1 comment

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