Hiding Index.php Results In 403 Error

I’ve been trying to hide index.php, following the guidance of numerous and helpful posts, in the URL but have been unsuccessful. My setup is as follows:

  • VirtualBox Ubuntu Server VM (Host is Windows 7)

  • Using a shared folder on host

  • webapp is a sibling to framework folder

  • mod_rewrite is enabled

Webapp runs fine unless I want to hide the script name. When using the following .htaccess config, I get a 404 error (URL not found):

Options +FollowSymLinks

IndexIgnore */*

RewriteEngine on

RewriteBase webapp

# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php

RewriteRule . index.php

Some other posts discussed the need to set some of the apache configs in /etc/apache2/default as follows:

<Directory /var/www/>

    Options All

    AllowOverride All

    Order allow,deny

    Allow from all


Doing this actually results in a 403 error (forbidden access).

Anyone have any suggestions?

could be permissions check if you have appropriate permissions

Usermod access was granted, if that is what you are referring to, and write access has been allowed. in the /var/www Directory setting, if I change AllowOverride to All instead of None to allow the .htaccess file to be used, then I get the 403 error.

can you post your config/main.php code

Sorry for the delay in my reply. Following is my config code (pretty standard):

return array(


	'name'=>'My Website',

	// preloading 'log' component


	// autoloading model and component classes






		// uncomment the following to enable the Gii tool







		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.





	// application components



			// enable cookie-based authentication



		// uncomment the following to enable URLs in path-format













			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',



		// uncomment the following to use a MySQL database


			'connectionString' => 'mysql:host=localhost;dbname=db',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => 'root',

			'charset' => 'utf8',



			// use 'site/error' action to display errors








					'levels'=>'error, warning',


				// uncomment the following to show log messages on web pages









	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']


		// this is used in contact page




I finally solved this. alirz23 was correct early in the topic when he proposed that it was a permissions issue. I had misunderstood what he was referring to. I fixed the access to the .htaccess file and it is now working.

Thank you!