Reputation: 5662
I am trying to transfer my codes from localhost to a live domain. The directory of the server is like this:
-www.example.com
--app
--cake
--vendors
--plugins
-- phpMyAdmin
-- htaccess
Since cakephp deals with the URL, when i try to access www.example.com/phpMyAdmin, cakephp complains that "PhpmyAdminController could not be found". I tried to change the htaccess in the app/webroot/htaccess to allow url of phpMyAdmin but it does not work. Can someone help?
I followed the tutorial from the following website: http://cakebaker.42dh.com/2006/08/17/take-over-the-control-of-some-urls-from-cakephp/. However i changed the htaccess in the webroot folder rather than the main folder.
I am really hoping for someone to help.
Upvotes: 3
Views: 5695
Reputation: 5662
I guess i had managed to find the answer and the best way to do without duplicating the phpmyadmin will be:
<IfModule mod_rewrite.c>
RewriteEngine on
rewritecond %{REQUEST_URI} ^/(phpMyAdmin)/
RewriteRule .* - [S=2]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
The above htaccess must be changed in the root directory of the cake and not the webroot. I do not want to take the credit and the credit goes to the participant of the forum at the following url:
http://cakephp.1045679.n5.nabble.com/Routing-to-an-external-application-td1274772.html
Upvotes: 1
Reputation: 8919
You can do it by modifying the .htaccess
file which is located outside app folder.
Please try with this. I'm using this particular code and its working for me.
<IfModule mod_rewrite.c>
RewriteEngine on
Rewriterule ^phpmyadmin/.*$ - [PT]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
Now you'll be able to run a directory like this http://example.com/phpmyadmin
Upvotes: 8
Reputation: 5481
you can put the phpMyAdmin folder in app/webroot/ . Access using the same url (with a slash at the end) www.example.com/phpMyAdmin/
Upvotes: 1