Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I Googled over and over and got no where so I figured I would give this a try.. I have OSCommerce in my httpdocs directory. Then I have /wordpress but changed the blog location to /blog.php with some mods. Works great. Now to add SEO URL's from Wordpress to my OSC htaccess

OSC htaccess;

Options +FollowSymLinks RewriteEngine On

RewriteBase /

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}

Wordpress htaccess

RewriteBase /blog.php/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog.php/index.php [L]

Is this even possible with two RewriteBase files? I looked at a way to do it with directory defines but didn't think it was possible as blog.php isn't a directory.

Thanks!

share|improve this question

1 Answer 1

It shouldn't be a problem combining the two. The [L] switch indicates to follow that rule and stop processing, so it should allow you to have your wordpress rules for example be parsed and processed and continue with the rest after if nothing has been matched. You don't need two rewritebase statements ... you can try something like this:

Options +FollowSymLinks 
RewriteEngine On 
RewriteBase /

RewriteRule ^/blog\.php.* /blog.php/index.php [L]


RewriteRule ^(.)-p-(.).html$ product_info.php?products_id=$2&%{QUERY_STRING} 
RewriteRule ^(.)-c-(.).html$ index.php?cPath=$2&%{QUERY_STRING} 
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} 
RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING} 
RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING} 
RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING} 
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING} 
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} 
RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}

It changes the wordpress part slightly in meaning, but you can modify that part to your needs - that's just to give you an idea what you can try.

share|improve this answer
    
I added that line.. Now none of the other rewrite rules work. Sadly I am not very good at rewrites.. –  William Langford Apr 19 '10 at 22:55
1  
try without the starting slash: RewriteRule ^blog\.php.* /blog.php/index.php [L] –  Ivan Peevski Apr 20 '10 at 2:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.