我在web根目录的project
文件夹中有一个Codeigniter项目。为什么RewriteRule不能在没有R标志的情况下工作.htaccess
www
www/.htaccess
www/project/.htaccess (here are its contents https://pastebin.com/qBbZ0REj)
WWW /的.htaccess
RewriteEngine On
RewriteRule ^pg/fetchPG/(.*)$ /project/product_groups/fetchPG/$1 [L]
的www/project/.htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
有关部分如果我做
http://localhost/pg/fetchPG/?groupid=26&response=html&mode=graph&response=html
它应该显示的内容
http://localhost/project/product_groups/fetchPG/?groupid=26&response=html&mode=graph&response=html
但它只是给我看Codeigniter的404
页面。
我认为Querystring丢失了,但我试图在该页面中打印$ _GET,这很好,它一直在。
我将[L]
替换为[L, R]
,它起作用,它重定向到该URL,但我不希望用户看到最终的URL。
PS:我有专门的服务器,我有一切控制权,请建议是否有其他方法来帮助我实现目标?
在你的文件系统的根目录下是否有'/ project'文件夹? –
@DusanBajic文件系统的根?不,'project'文件夹在'www'中,意思是它在'www/project'中的位置..请参阅问题,我试图解释我有的目录结构 – Umair
文档是否位于'www'或'www/project '? –