【发布时间】:2015-11-17 21:47:15
【问题描述】:
您好,我对友好的 URL 站点进行了以下重定向
<IfModule mod_rewrite.c>
Options +FollowSymLinks -Multiviews
RewriteEngine on
RewriteBase /
RewriteRule ^$ /beta/ [L] // Got this from a fellow user in SO but didn't worked
RewriteRule ^home index.php
RewriteRule ^noticia/([\w-]+)/?$ noticia.php?title=$1 [L,QSA,NC]
RewriteRule ^busqueda/([\w-]+)/?$ busqueda.php?item=$1 [L,QSA,NC]
RewriteRule ^producto/([\w-]+)/?$ producto.php?item=$1 [L,QSA,NC]
RewriteRule ^noticias/page/([\w-]+)/?$ noticias.php?query=$1&page=$2 [L,QSA,NC]
RewriteRule ^noticias/tag/([\w-]+)/?$ noticias.php?query=$1&keyword=$2 [L,QSA,NC]
RewriteRule ^noticias/search/([\w-]+)/?$ noticias.php?query=$1&keyword=$2 [L,QSA,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]
</IfModule>
这是我网站的链接
我希望,当用户直接访问该地址时,会被重定向到子文件夹中的 Beta 文件
到目前为止,我没有工作。
【问题讨论】:
标签: regex .htaccess mod-rewrite redirect