开发者

cakephp alias url

开发者 https://www.devze.com 2023-01-03 22:18 出处:网络
The url structure of my cakephp based site is mysite/cakephp/myapp/index.php/controller/action/input_paramaters

The url structure of my cakephp based site is mysite/cakephp/myapp/index.php/controller/action/input_paramaters

I cannot remove index.php from my url, as I dont have access to httpd.conf file.

Anyways, my question is that I just need to change the url of my homepage to something like http://mysite or mysite/myapp

How would I do that?

Thanks开发者_JAVA技巧 a lot!!


The problem sounds to me that you don't have mod_rewrite enabled or Apache AllowOverwrite is not set properly.

If you don't have mod_rewrite then you cannot change the urls with the pretty ones (provided from CakePHP). If the AllowOverwrite is not set to On. Then even if you have mod_rewrite enabled, the .htaccess files in your directories doesn't take effect.

I don't know which is worst. Speak with your hosting provider and ask for help.


It is not really clear to me which part of the URL changes. CakePHP routing applies only relative from the cake directory. So if you move from http://example.com/foo to http://www.example.org/bar nothing needs to be changed in Cake.

However you might have hardcoded some img/CSS/JS URL-s that needs some work now. I also use the HTML base tag so my app works perfectly fine under various base URL-s.

0

精彩评论

暂无评论...
验证码 换一张
取 消