Reputation: 2040
I'm trying to keep my root directory clean by not dumping the cake folders in the directory, but I don't want the url to be www.example.com/cake. Instead I need it to be www.example.com
What's the best way to accomplish this? I've been messing around with the htaccess files for a while, but have not yet resolved the issue. So far I have figured out how to redirect to the subdirectory, but it shows up as www.example.com/cake, when I would like it to just show up as www.example.com.
I'm currently hosted on Media Temple GS, so I dont have access to the apache config files.
Thanks!
Upvotes: 5
Views: 3421
Reputation: 29536
You should place this into your root directory's .htaccess
file
// .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ cake/app/webroot/ [L]
RewriteRule (.*) cake/app/webroot/$1 [L]
</IfModule>
Upvotes: 2
Reputation: 1138
There is routes.php file in app/config folder open it and it will look like
<?php
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'login'));
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
you just need to change the word login to any view file you want to load first when you open your site and its done................
Upvotes: 1