我GOOGLE了一遍又一遍,没有得到的地方,所以我想我会给这个尝试..我有我的httpdocs目录中的OSCommerce。 然后,我有/ WordPress的,但改变了博客的位置到/blog.php与一些MODS。 很好用。 现在从Wordpress添加SEO URL到我的OSC htaccess
OSC htaccess;
选项+ 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]
这甚至有可能与两个RewriteBase文件? 我看了一个方法来做目录定义,但不认为这是可能的,因为blog.php不是一个目录。
谢谢!
把两者结合起来应该不成问题。 [L]开关指示遵循该规则并停止处理,所以它应该允许你让你的wordpress规则被parsing和处理,如果什么都没有匹配,继续处理剩下的规则。 你不需要两个rewritebase语句…你可以尝试这样的事情:
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}
它在意义上稍微改变了wordpress部分,但是你可以根据你的需要修改这个部分 – 这只是给你一个想法,你可以尝试。