Using Wordpress in zc - Problem with index.php URL
So I have kind of a mess of htaccess rewrites. They are a combination of lines from CEON URI Mapping and some instructions I found here about how to display my Wordpress blog inside zc:
https://www.numinix.com/blog/2009/09...n-cart-1-3-8a/
It appears to work fine, but my problem is Google is indexing all my blog posts with an appended index.php at the end for some reason. And every time a visitor clicks through on such a link, ie:
http://www.mysite.com/blog/how-to-ma...uits/index.php
it gives a 404 error.
How can I modify this to remove the index.php from all URL paths starting with /blog/ ?
Code:
RewriteEngine On
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/sysop [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel [NC]
RewriteCond %{REQUEST_URI} !/frontend [NC]
# Don't rewrite blog directory
RewriteCond %{REQUEST_URI} !^/blog [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule .* index.php?%{QUERY_STRING} [L]
# Rewrite blog directory to display WP inside zencart, but exclude the blog-backend directory because that's my actual WP directory
RewriteCond %{REQUEST_URI} !^/blog-backend [NC]
RewriteRule ^blog(.*)$ index.php?main_page=blog&$1 [E=VAR1:$1,QSA,L]
Re: Using Wordpress in zc - Problem with index.php URL
Try this
Code:
RewriteEngine On
RewriteBase /
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/sysop [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors [NC]
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel [NC]
RewriteCond %{REQUEST_URI} !/frontend [NC]
# Don't rewrite blog directory
RewriteCond %{REQUEST_URI} !^/blog-backend [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule .* index.php?%{QUERY_STRING} [L]
# Rewrite blog directory to display WP inside zencart, but exclude the blog-backend directory because that's my actual WP directory
RewriteCond %{REQUEST_URI} !^/blog-backend [NC]
RewriteRule ^blog(.*)$ index.php?main_page=blog$1 [E=VAR1:$1,QSA,L]
~Melanie