View Full Version : redirect with .htaccess

11-21-2010, 05:06 PM
Working with cakePHP

My index.php is in sub/app/webroot

Previously, on shared hosting I just replaced "domain.com/" with "domain.com/app+core directories"

I've moved to dedicated virtual server and am hitting a 403 forbidden error: "You don't have permission to access /sub/ on this server."

Permission is set to 755.

In domain.com/sub/app -> .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /sub/app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]

In domain.com/sub/app/webroot -> .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteBase /sub/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

I've tried:
Right now httpdocs/ contains blank index.html and simple redirect: Redirect /index.html http://arizonadealz.com/sub/

Creating another .htaccess file for /sub, but that seemed to confound things further.

Thanks for the help.

11-23-2010, 05:06 AM
Hi, i have problem with .htaccess
When i run localhost , the website don't run and then del file htaccess so site run
Who can help me conf .htaccess