您好,我有一个友好的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文件
到目前为止我没有工作。
答案 0 :(得分:1)
试试这个:
Options +FollowSymLinks -Multiviews
RewriteEngine on
RewriteBase /
RewriteRule ^/?$ /beta/ [L,R]
RewriteRule ^home index.php [L]
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]