简体   繁体   English

.htaccess没有赋予请求的URL | codeigniter url路由

[英].htaccess not fallowing the requested url | codeigniter url routing

The original URL : 原始网址:

https://www.doctor24.ro/i/index.php/en/property/54a402a9d4f13/Sapientek-Ecografie https://www.doctor24.ro/i/index.php/en/property/54a402a9d4f13/Sapientek-Ecografie

The requested url after .htaccess : .htaccess之后的请求网址:

https://www.doctor24.ro/i/cabinet/Sapientek-Ecografie https://www.doctor24.ro/i/cabinet/Sapientek-Ecografie

The .htaccess .htaccess

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^cabinet/(.*)$ ./index.php/en/property/([a-zA-Z0-9-=_?]+)*$

What is the problem ? 问题是什么 ?

UPDATE : 更新:

The script I'm using uses the codeigniter url routing . 我正在使用的脚本使用codeigniter url路由

已更新立即尝试以下操作:

RewriteRule ^i/cabinet/(.*)$ i/index.php/en/property/$1

You cannot use regex on right hand side, just use back-reference variable. 您不能在右侧使用正则表达式,而只能使用反向引用变量。 Also looks like you're placing this .htaccess in /i/ folder. 看起来您也将这个.htaccess放在/i/文件夹中。 You will need to use appropriate RewriteBase as well: 您还需要使用适当的RewriteBase

Options +FollowSymLinks
RewriteEngine On
RewriteBase /i/

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^cabinet/(.*)$ index.php/en/property/$1 [L,NC]

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

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