0

I'm relatively new to both .htaccess and regular expressions, but I really need to do the following. I'm using Drupal for my website (I don't know if the affects anything) but I've wrote a small PHP script that emails a confirmation link to users.

The page that actually processes the link is mysite.com/process?uniqueurl=confirmationLink but I want to be able to email by users the following link mysite.com/reset/confirmationLink.

Could someone give me the code that I need in order to do this? Thanks in advance.

PS: The URLs are obviously not the real ones but they are an accurate representation of my current situation!

4

2 回答 2

1

尝试以下操作:

RewriteEngine On
RewriteRule ^reset/(.*)$ http://mysite.com/process?uniqueurl=$1
于 2012-05-26T11:48:44.690 回答
1

通过启用 mod_rewrite 和 .htaccess httpd.conf,然后将此代码放在您.htaccessDOCUMENT_ROOT目录下:

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

RewriteRule ^reset/([^/]+) process?uniqueurl=$1 [L,NC,QSA]
于 2012-05-26T11:59:45.873 回答