我有一个推荐朋友模块,它为人们提供了一个长推荐网址
我想缩短它以使人们更容易输入,但可以弄清楚如何在 .htaccess 中完成它
下面是我的 .htaccess 的重写部分
我想重定向
/ap/ * to /awardpoints/index/goReferral/referrer/ ( ** 是客户 ID)
我试过了:
RewriteRule ^ap/([0-9]+)$ /awardpoints/index/goReferral/referrer/$1 [R]
但它不起作用
<IfModule mod_rewrite.c>
############################################
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
############################################
## you can put here your magento root folder
## path relative to web root
#RewriteBase /magento/
############################################
## workaround for HTTP authorization
## in CGI environment
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]
############################################
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>