Apache Mod_Rewrite问题.htaccess

时间:2015-04-09 19:32:23

标签: apache mod-rewrite

我正在尝试创建一个将改变以下内容的mod重写:

https://example.com/app/landinghttps://example.com?keyword=landinghttps://example.com/app/adwordshttps://example.com?keyword=adwords

但是,我无法这样做。 我正在使用codeiginter,它已经需要一些规则来防止index.php?在URL中,因此我不确定这是否会造成我的问题。

以下是当前代码:

RewriteEngine On
RewriteBase /app/

Try 1:
RewriteRule landing https://example.com/?keyword=landing [R]

Try 2:
RewriteRule ^landing?/ https://example.com/?keyword=landing [R]

Try 3:
RewriteRule ^landing?/ https://example.com/?keyword=landing [R]

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]  

你们有什么建议吗?

0 个答案:

没有答案
相关问题