Regex 将文件夹后面的变量重写为文件夹之外的文件
我正在尝试重写此URL:Regex 将文件夹后面的变量重写为文件夹之外的文件,regex,apache,.htaccess,url,mod-rewrite,Regex,Apache,.htaccess,Url,Mod Rewrite,我正在尝试重写此URL: http://mywebsite.com/new/agenda/2014/7/activity-1 到 我不在.htaccess的家中,但我知道这是可能的,因为其他网站都使用它(如Wordpress)。如何执行此操作?将此规则放置在/new/.htaccess中: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase /new/ RewriteRule ^(agenda)/(\d+)/(\d
http://mywebsite.com/new/agenda/2014/7/activity-1
到
我不在
.htaccess
的家中,但我知道这是可能的,因为其他网站都使用它(如Wordpress)。如何执行此操作?将此规则放置在/new/.htaccess
中:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /new/
RewriteRule ^(agenda)/(\d+)/(\d+)/([^/]+)/?$ $1.php?year=$2&month=$3&title=$4 [L,QSA,NC]
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /new/
RewriteRule ^(agenda)/(\d+)/(\d+)/([^/]+)/?$ $1.php?year=$2&month=$3&title=$4 [L,QSA,NC]