Forum Moderators: phranque
I'm new to htaccess and have been working a this problem forever. I have a htaccess file which handles my ecommerce store urls and redirects. I need my wordpress directory not to be affected by the rules listed below. Any help would be very appreciated. Thank you!
DirectoryIndex /mm5/merchant.mvc
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/p/(.*)/(.*)[NC]
RewriteRule (.*) /mm5/merchant.mvc?Screen=PROD&Product_Code=%1&Category_Code=&Store_Code=DCS [L]
RewriteCond %{REQUEST_URI} ^/pc/(.*)/(.*)/(.*)[NC]
RewriteRule (.*) /mm5/merchant.mvc?Screen=PROD&Product_Code=%1&Category_Code=%2&Store_Code=DCS [L]
RewriteCond %{REQUEST_URI} ^/c/(.*)/(.*)[NC]
RewriteRule (.*) /mm5/merchant.mvc?Screen=CTGY&Category_Code=%1&Store_Code=DCS [L]
RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com [R=301,L]
[edited by: jdMorgan at 3:41 pm (utc) on Jan. 11, 2008]
[edit reason] example.com [/edit]
If so, then the "standard" WordPress code should always run first, and this code should never be invoked, because the WordPress code basically rewrites *all* incoming requests to WordPress unless the requested URL resolves directly (without rewriting) to an existing physical file.
If that is the case, you will need to move these MM rules into the same .htaccess file as the WP rule, and modify them to suit. The MM5 rules will need to be placed before the WP rules so that the two sets don't interfere with each other.
We'll need more information about all of your .htaccess files and rules, and also about your directory structure, before proceeding.
Note also that your rules can be simplified and shortened. The RewriteConds are not required. For example, your first rule can be re-written as:
RewriteRule ^p/([^/]+)/(.*)$ /mm5/merchant.mvc?Screen=PROD&Product_Code=$1&Category_Code=&Store_Code=DCS [NC,L]
Jim
Wordpress didn't have it's own htaccess so I created one (which is currently blank).
The place where I get hung up is once I have the same rules in the wordpress file I don't know how to "modify them to suit".
directory structure:
root (main htaccess file lives here)
-wordpress
All the code in the main htacess has been posted in this post.
I hope I provided the info you needed.
Thanks very much for the help.
Brady
Where are you in this project? Did you have Wordpress working before or is this a new install? Did you perhaps overwrite the .htaccess file it generated? How about Miva -- is that new or did you have it working before?
One of the problems here is that we literally don't know anything about your site and server unless you write about it -- That's just part of the nature of this (or any) forum, but feel free to tell us as much as you can (without specifics that might identify your site to friend or foe). ;)
Jim
I've looked through my directories for another htacess file associated with wordpress and I'm not finding anything. I un-installed and reinstalled and still didn't have one.
It's a new install. Wordpress is working, but because of my redirects for miva dynamic content urls redirect to my miva ecommerce store.
I've had Miva running for around a year now with the current htaccess code I provided with my post.
Thank you,
Brady
[edited by: tedster at 4:14 am (utc) on Jan. 12, 2008]
[edit reason] no personal urls, thanks [/edit]
One way to do it is to put WP in a special subdirectory, or put MM is a subdirectory, or both. In this way, mod_rewrite can examine the requested URL-path, e.g. /mm/<something> or /wp/<something>, and rewrite the requests accordingly.
Another way to do it is to put each of them in their own subdomain IF your host supports this and IF you can set up your DNS so the subdomains resolve to the server.
Without something to tell mod_rewrite which resource a requested URL is intended for --your blog or your cart-- then it's simply going to rewrite all request to one or the other, depending on what rule comes first.
Jim