我有CakePHP简单程序(CakePHP:版本2.1.3,Centos 6.x和Apache:2.2.15)。cakephp重写url不起作用
现在我想改变URL从:http://domain.com/frontend/login
新的网址,如:http://domain.com/user-login.html
我想用新的URL,并删除旧的URL。
我尝试重写(通过配置.htaccess与mod重写,我已经配置/etc/httpd/conf/httpd.conf:更改AllowOverride None to AllowOverride All)。
和一些.htaccess文件等初级讲座:
/root/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
#rewrite to new url
RewriteRule ^frontend/login$ user-login.html [L]
</IfModule>
/root/app/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
和/根/应用程序/根目录/ .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
但我的新网址http://domain.com/user-login.html不起作用。
我的配置有什么问题吗?
添加一些错误记录到你的web服务器配置或应用程序,并帮助澄清你是什么意思时,你说你的URL ISN没有工作。 – davidjb