Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 重写问题_Wordpress_.htaccess_Rewrite_Oscommerce - Fatal编程技术网

Wordpress 重写问题

Wordpress 重写问题,wordpress,.htaccess,rewrite,oscommerce,Wordpress,.htaccess,Rewrite,Oscommerce,在我的网站中,我有这样的链接: 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 Rewrit

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

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>

#选项+FollowSymLinks
重新启动发动机
重写规则^loja/product\U info/products\U id/([0-9]+)$http://www.mysite.com/loja?slug=product_info.php&products_id=$1[NC,L]
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#重写规则^loja?slug=.+/([a-z\+\.php.*)$$1[L]
#重写规则^product\U info/products\U id/([0-9]+)$loja?slug=product\U info.php&products\U id=$1[QSA,L]
#RewriteCond%{QUERY\u STRING}^options\=(.*)$
#重写规则^(.*)-p-(.*).html$product_info.php?products_id=$2%1
#重写规则^slug/([^/]+)/([^/]+)/([0-9]+)/?slug=$1和$2=$3[QSA,L]
#重写规则^([^/]+)/([^/]+)/([^/]+)/([0-9]+).$?$1=$2和$3=$4[L]
#重写规则^slug/([^/]+)/products_id/([0-9]+)$?slug=$1和products_id=$2[QSA,L]
#loja?slug=product\u info.php&products\u id=1308
#重写规则^page/([^/]+)/([^/]+)/([0-9]+)/?/?slug=$1和$2=$3[QSA,L]

谢谢

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


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

现在正在使用您的代码工作,但我不想显示内部链接,谢谢!