-4

在我的网站上,我有这样的链接:

www.mysite.com/loja/product_info/products_id/1301

我只是想在服务器内部将其重写为:

www.mysite.com/loja?slug=product_info.php&products_id=1301

任何帮助将不胜感激

我的 .htaccess :

<IfModule mod_rewrite.c>
#Options +FollowSymLinks
RewriteEngine On
RewriteRule ^loja/product_info/products_id/([0-9]+)$ http://www.mysite.com/loja?slug=product_info.php&products_id=$1 [NC,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#RewriteRule ^loja?slug=.+/([a-z_]+\.php.*)$ $1 [L]
#RewriteRule ^product_info/products_id/([0-9]+)$ loja?slug=product_info.php&products_id=$1 [QSA,L]
#RewriteCond %{QUERY_STRING} ^options\=(.*)$
#RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2%1

#RewriteRule ^slug/([^/]+)/([^/]+)/([0-9]+)/? ?slug=$1&$2=$3 [QSA,L]
#RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([0-9]+).*$ ?$1=$2&$3=$4 [L]
#RewriteRule ^slug/([^/]+)/products_id/([0-9]+)$ ?slug=$1&products_id=$2 [QSA,L]
#loja?slug=product_info.php&products_id=1308
#RewriteRule ^page/([^/]+)/([^/]+)/([0-9]+)/? /?slug=$1&$2=$3 [QSA,L]

</IfModule>

谢谢 !

4

1 回答 1

0

在任何 wordpress 规则之前在您的 .htaccess 中尝试此操作。

RewriteRule ^loja/product_info/products_id/([0-9]+)$ http://www.mysite.com/loja?slug=product_info.php&products_id=$1 [NC,L]

于 2012-05-13T01:01:13.800 回答