tags:

views:

65

answers:

2

Hi all,

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 a lot!!

A: 

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.

sibidiba
what am looking for is to rewrite url in cakephp, but the prob is, I cannot set overwrite all, cause I dont have access to that apache file, as my site is hosted on rackspace cloud sites, and there they dont allow acces to that file.So, how wud I do it then, and anyways, I just want to edit the home url, so if there is any easy way to do it, that will do my job..
tecks
If your app works without URL rewrites, then just move the folder. Cake does not know such a thing as home url. It just works out of the folder it is placed into. What folder is served by your provider depends on your hosting environment, not cake. BTW, it is a looooosy service if you can't have your own .htaccess (with mod_rewrite). You do not need to have access to global apache config for this. Most hostings even allow custom php.ini-s ...
sibidiba
Thank You all, for your advices, that gave me some hint,and my problem is solved now.....
tecks
+1  A: 

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.

Nik
Yea, my site is hosted on rackspace cloud sites, and there they dont allow access to apache conf files. So there is no way for me to set the overwrite option.So, is there no other way, I could be able to rewrite the url???
tecks