2012-05-13 87 views
-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> 

謝謝 !

回答

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]

+0

現在是工作,你的代碼,但我不想顯示內部鏈接,謝謝! – user1391670