繁体   English   中英

htaccess URL重定向到beta子文件夹,同时使用友好的URL重写

[英]htaccess URL redirect to beta subfolder, while using friendly URL rewrite

嗨,我对友好的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文件

REDIRECT

到目前为止,我没有用。

尝试这个:

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]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM