开发者

.htaccess, mod-rewrite and Wordpress

I have inherited a wordpress project and am having some problems with rewriterules in the .htaccess file. I am trying to set it up such that this url:

site.com/meet-your-team/something/somethingelse

ret开发者_Python百科urns

site.com/meet-your-team/index.php?page_id=30&param2=something&param3=somethingelse

This worked without any problems when it was hosted on a windows box, unfortunately it is bombing on the linux server we currently have it on.

When troubleshooting the problem, I found out that all three parameters are making it to the index.php page and wordpress is using the page id to generate the page I need. However it seems to lose the other two parameters when the page is displayed. Does anyone have any ideas how I can keep parameters 2 and 3?

This is the line of code I am using. I am new to htaccess and rewrites so forgive me if all I am missing is a single character.

RewriteRule meet\-your\-team/([^/]+)/([^/]+)/? index.php?page_id=30&category_slug=$1&profile_slug=$2 [L]

Thanks in advance for anyone willing to point me in the right direction.


I think you need to add a rule that has three things to be replaced, and if I'm not mistaken, you need to start the first string with a caret and end it with a dollar sign, so:

RewriteRule ^meet\-your\-team/([^/]+)/([^/]+)/([^/]+)/?$ index.php?page_id=30&category_slug=$1&profile_slug=$2&third_slug=$3 [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜