简体   繁体   English

.htaccess在wamp apache上的网址重写规则

[英].htaccess Url rewrite rule on wamp apache

I have a url in my application: 我的应用程序中有一个网址:

www.example.com/application/30201:1234 www.example.com/application/30201:1234

I hit this URL its throws an error. 我点击此网址会引发错误。

Forbidden 被禁止

You don't have permission to access /application/30204:1234 on this server. 您无权访问此服务器上的/ application / 30204:1234。

Main config for rules is as follow: 规则的主要配置如下:

'rules'=>array( '<call:[0-9]+\\:[0-9]+>( sip<sip:(\\:[A-Za-z0-9]*@infocus\\.net)+>)?( email<email:(\\:[A-Z0-9a-z\\._%\\+\\-]+@[a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})+>)?'=>'user/index', '<controller:\\w+>/<id:\\d+>'=>'<controller>/view', '<controller:\\w+>/<action:\\w+>/<id:\\d+>'=>'<controller>/<action>', '<controller:\\w+>/<action:\\w+>'=>'<controller>/<action>', ),

I want to add rewrite rule in .htaccess which will redirect my application to user/index. 我想在.htaccess中添加重写规则,这会将我的应用程序重定向到用户/索引。

当您点击第一个网址时,在您的.htaccess文件中添加此行,它将重定向到下一个网址

Redirect /root_directory/first_url_path /root_directory/second_url_path

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

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