文件.htaccess RewriteRule [英] file .htaccess RewriteRule

查看:159
本文介绍了文件.htaccess RewriteRule的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是场景:
www.example.com/test_folder
在test_folder中,我正在尝试编写.htaccess文件.
该文件的目的是将所有请求重定向到 www.example.com/test_folder/any_file_or_no_file 到test_folder/public/*
这是我尝试过的:

 RewriteEngine on
RewriteRule/test_folder/.*/test_folder/public/$ 1 



书面改写不起作用.没有像我期望的那样转发.

解决方案

1



书面改写不起作用.没有像我期望的那样转发.
会感激不尽.


目前尚不清楚您希望获得什么样的帮助.一切都在这里说明:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html [ ^ ],
http://httpd.apache.org/docs/current/mod/mod_rewrite.html [ ^ ].

-SA


参考:www.example.com/test_folder/any_file_or_no_file to test_folder/public/*
This is what I tried:

RewriteEngine on
RewriteRule /test_folder/.* /test_folder/public/$1



Written rewriterule is not working. Not forwarding as I am expecting.
Little help would be appreciated.

解决方案

1



Written rewriterule is not working. Not forwarding as I am expecting.
Little help would be appreciated.


It''s not clear what kind of help would you expect. Everything is explained here:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html[^],
http://httpd.apache.org/docs/current/mod/mod_rewrite.html[^].

—SA


Refer: How+do+I+redirect+my+site+using+a+.htaccess+file[^]


这篇关于文件.htaccess RewriteRule的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆