English 中文(简体)
重写一个 URL 以包括 Get 数据( 使用 Drupal)
原标题:Rewrite a URL to include GET data (with Drupal)

我对.htaccess和正则表达式都比较新, 但我真的需要做以下工作。 我在网站上使用 Drupal 网站( 我不知道是否受到影响), 但我写了一个小PHP脚本, 将确认链接发至用户 。

实际处理链接的页面是 mysite.com/ process? uniqueurl=confirmationLink, 但我希望用户能通过电子邮件发送以下链接: mysite.com/reset/ concreditationLink。

有人能给我我需要的密码吗?

PS:URLs显然不是真实的,

最佳回答

通过 httpd.conf 启用mod_rewriter和.ht access,然后将该代码输入您的 .ht access DOCUONT_ROOT 目录:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^reset/([^/]+) process?uniqueurl=$1 [L,NC,QSA]
问题回答

试一下

RewriteEngine On
RewriteRule ^reset/(.*)$ http://mysite.com/process?uniqueurl=$1




相关问题
URL rewrite in IIS6 - Third party tools

I have collected the following api/sdk/whatever which provide modules for doing url rewriting in IIS 5/6/7. Some are free-open source and some require $. I haven t tried any of them. I would like to ...

Rewrite spring-security redirect URLs

I m trying to get Tuckey UrlRewriteFilter to tidy up URLs for my webapp. One problem I ve got is that when spring-security notices that an anonymous user is trying to access a protected resource it ...

ASP.NET Friendly URLs

In my research, I found 2 ways to do them. Both required modifications to the Application_BeginRequest procedure in the Global.Asax, where you would run your code to do the actual URL mapping (mine ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

Domains & Foreward Slash

This is rather difficult to explain so please bear with me. We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain: site-a.com site-b.com sub1.site-b....

URL Mod-Rewrite

I currently have a working URL: http://example.com/security-services.php?service=fixed-camera-surveillance and then I have PHP say, $_REQUEST[ service ] to do some stuff... But I d like to ...

热门标签