开发者

mod_rewrite take part of url and add it to the end of a second url

I am attempting to make it where faculty or students at my library that have a pmid number for PubMed, and want to share the link with others could do it by just remembering our url, and adding the pmid to the end of our url, with the identifier p.

This is where mod_rewrite comes in it would drop off the url: site.com/p/112233444 but ke开发者_JAVA百科ep 112233444 and then add it to the end of linkresolver.com/112233444

The rule that I have come up with is:

RewriteRule ^/p/(.*)$ linkresolver.com=$1

First, is this possible I control the library domain, but I am not in control of the second url that I am attempting to add the PMID to.

Second, this is my first attempt at mod_rewrite so if I am way let me know I have looked at Apache's documentation. I know it is really powerful complex tool, so my rewrite rule just seems off.

Any help would be greatl


Does this work?

RewriteRule ^p/(.*)$ http://linkresolver.com/$1 [R]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜