Tags
Sometime we may need to put cakephp in a sub directory insted of document root directory, and we need to get the site from root.
Our document root directory is /httpdocs/ and we put the cakephp inside it /httpdocs /cake_sub/ and we want access the site from http://www.my-domain-name.com not http://www.my-domain-name.com/cake_sub
1. In this case we need to create a .htaccess file and put it to /httpdocs/ and the content is as follow
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteRule ^$ cake_sub/app/webroot/ [L] RewriteRule (.*) cake_sub/app/webroot/$1 [L] </IfModule>
So we need to on the RewriteEngine Now we need to edit the .htaccess files from the following locaiton
- cake_sub/
- cake_sub/app
- cake_sub/webroot
2. Need to edit the .htaccess from /httpdocs/cake_sub as following
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /cake_sub/ RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule>3. Need to edit the .htaccess from /httpdocs/cake_sub/app as following<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /cake_sub/app/ RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule>4. Need to edit the .htaccess from /httpdocs/cake_sub/app/webroot as following
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /cake_sub/app/webroot/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule>
Done, It worked with me and hope it’ll work with you too. I just put the document root httpdocs and sub directory name as an example.
Didn’t work for me I’m afraid 😦
Hi,
Thank you for the directions. I followed them very carefully but it worked only a part of it. CSS and javascript is missing. Any ideas?
Pingback: free website directory advertising
Pingback: Directory For SEO
perfect! worked ! thank you very much!
Thank you! Worked perfect. Spent a few hours figuring how how to have Joomla in my main root directory and a cake application in a sub!
Thanks , I’ve just been looking for info approximately this subject for a long time and yours is the best I have discovered till now. However, what in regards to the conclusion? Are you certain concerning the supply?
Useful info. Lucky me I discovered your web site accidentally,
and I am shocked why this twist of fate did not happened earlier!
I bookmarked it.
Work’s like a charm!
Having a high forehead was also considered to be
an asset for women during the medieval period.
OH GOD ! THANKS YOU SO MUCH !
thanks its really useful
Awesome after spending 5 hours get a perfect solution
Big Big Big Thanks