cakephp and wordpress in single domain
If you are hosting multiple cakephp websites TOGETHER with your wordpress in one single domain, you might encountered some errors or incorrectly display css or images in your cakephp web application.
This is due to the default mod_rewrite rules that come with cakephp installation as it is assume that the application is running for one domain name only.
Fortunately, it is possible to amend that mod_rewrite rules to allow apache to customise different routes for different applications.
Before I explain on how to do it, lets see how I configure entroducing.com
www.entroducing.com -> will call default wordpress (this blog)
www.entroducing.com/project/app1-> will run app1 cakephp
www.entroducing.com/project/app2> will run app2 cakephp
In the webroot folder of your cakephp application, edit the .htaccess file and add the following line
RewriteBase /[subdirectory]/[applicationname]
And it should looks like this
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /project/stepup RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule>
Save the file and test your application. It should works fine now. 🙂
Similar Posts:
- Installation of Magento CE 2.3.5 in XAMPP Windows 10
- Posting Source Code in WordPress
- finally got this website up
- 3th Theme Updates Since 2005!
- Redirect Magento category to a URL
thanks, was useful!
Mighty useful, thanks a lot for this mate!