开发者

Wordpress htaccess problem

开发者 https://www.devze.com 2022-12-23 05:02 出处:网络
I have some problem with my .htaccess file. Here I am adding my problem. Please 开发者_开发问答help me.

I have some problem with my .htaccess file. Here I am adding my problem. Please 开发者_开发问答help me.

My actual URL is as follows http://localhost/buydualit/?searchitem=toaster&pagenum=1 here by using my .htaccess am rewrited my URL as http://localhost/buydualit/toaster-1/

My URL rewriting rule is like follows:

RewriteRule ^[A-Za-z-0-9,\"'-\/]+\-([0-9]+)\/$ buydualit/index.php?pagenum=$1&searchitem=$2

In this rule how can I retrieve toaster from http://localhost/buydualit/toaster-1/ (searchitem=$2 which is not getting)? Please help me.


Put parentheses around the parts of the expression you want. I removed the / char from your set of characters so it'd not grab the buydualit/ part of the url, and put it outside the grabbing section. Finally, the grabbed parts are numbered sequentially, so you have to switch $1 and $2

RewriteRule ^buydualit/([A-Za-z-0-9,\"'-]+)-([0-9]+)\/$ buydualit/index.php?pagenum=$2&searchitem=$1

Also, this probably doesn't belong here, as it's more of a system administration question than a software development question.

0

精彩评论

暂无评论...
验证码 换一张
取 消