I've spent much time to find out this trouble, that my cakephp running on my localhost server, but when I move my cakephp to hosting server, cakephp just shows blank page, anyone have codes .htaccess in root folder, cakephp folder, and another that need for my cakephp running on server ?
for your information, my cakephp version is cakephp 3
I've tried with this code
in root .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
in my folder cakephp .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /my_app_name
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
in my webroot folder
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
for many tutorial that I've read, they said we have set 3 .htaccess file, is there any wrong code in my .htaccess file so I cannot access my website?
[CASE CLOSED]
The solutions is just make sure your php already enable intl in your hosting / shared server
Related
I have a WordPress site hosted on AWS and I am having a hard time to configure mod_rewrite to work correctly.
Folder structure
/root
|_ staging/
|_ live/
The .htaccess is the WordPress default
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Main Problem
I can access /staging/index.php/api which I used to access it without subdirectories like this ---.com/api.
When I try /staging/api it shows File not found.
I tried to change the .htaccess to different thing but none of them was successful.
There are no .htaccess file in the root directory.
Some help would be appreciated =)
Thanks in advance.
Try this code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /staging
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /staging/index.php [L]
</IfModule>
Note: The AllowOverride should be set to All in server configuration.
You can find the reference from here.
How to Set AllowOverride all
i get a 403 when i browse to the root directory of my laravel project. When i go to root/public i do get a you have arrived message from the framework. But this isnt what is supposed to be right? How do i make my project so that when i go to the root i actually get into /public?
i have tried the following:
This is how my htaccess file looks like in in the root:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
You need to set DocumentRoot properly in your Apache configuration. This is separate from the .htaccess and it should point at the public directory.
If you can't configure apache directories, for production environment, put 2 .htaccess files.
The 1. is in the root folder:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
The 2. is in the /public folder:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I'm trying to install CakePHP in www.domain.com/demo/realestate I changed .htaccess in root, app,webroot with ref from cakebook, S.O. and other websites. Most of them produced either 500 error or shown a blank page or 404 error.
My .htaccess code in each of those files are:
--in root--
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /demo/realestate
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
--in app--
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
--in webroot--
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I also tried to delete all .htaccess and write Configure::write('App.baseUrl', env('SCRIPT_NAME')); in app/config/core.php as per a suggestion in documentation but then it started taking demo as controller name and realestate as function name.
I request you to guide me to set it up!
There is no need to change in htaccess if you want to install cakephp in www.domain.com/demo/realestate. Just copy all cakephp files and folders in realestate folder with default htaccess and it'll work.
I have a Cakephp backup and I want to setup it on my local xampp setup. I backup it from the server in which it is running smoothly. When I want to open using localhost, it displaying the /app/webroot/ directory listing.
I am using windows 7 with xampp. I started mod_rewrite already.
my .htaccess file has
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
DirectoryIndex /front/default.php
</IfModule>
Something is wrong in your document. Your .htaccess should like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Try this code:
DirectoryIndex index.php
RewriteEngine on
RewriteRule ^(.*)$ app/webroot/$1 [L]
I'm new using cakephp, and I'm trying to set Friendly URLs for my site, but I'm having problems.
I've already made all the steps that the cakephp 2.3 Book says, and my apache configuration says that the mod_rewrite is being executed.
And when I enter the main page of cake, it says that the URL rewriting is not configured, and when I want to acces to my web I need to go throught www.mysite.com/index.php/controller/function and of course, i want this: www.mysite.com/controller/function, and if I try this route, it says that is not found in my server (and I have the controller and function created).
This are my .htacces files:
root directory:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
App directory:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
Webroot directory:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
I resolved It. in the file /etc/apache2/sites-enabled/000-default the directory was pointing to /var/www and my cakephp directory was in /var/www/html/myapp/cakephp. I changed it and now its working! :)