0

I have been following this tutorial on youtube:

https://www.youtube.com/watch?v=ck5pTkRumPw&t=351s

Around the 12:00 minute mark, the tutorial talks about updating the .htaccess file so you can navigate to the page without using index.php.

I have not been able to access the page in this manner.

I'm using Windows 2008 server called server01 (if that even matters).

My file structure is as follows:

codeIgniter
  >Application
  >System
  .htaccess
  index.php

Currently, my .htaccess file looks like this:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

In my config file, I have the following:

$config['base_url'] = 'server01.usa.tests.com/codeIgniter/HomeController';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

On the routes.php file, I have the following:

$route['default_controller'] = 'HomeController';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

I even updated my httpd.conf file to include the following:

<Directory "d:/htdocs/codeIgniter">
  Options FollowSymLinks
  AllowOverride All
  Order deny,allow
  Deny from all
  Satisfy all   
</Directory>

Since I've updated the httpd.conf file, now when I navigate to the site, I am getting the following error:

**Forbidden**

You don't have permission to access /codeIgniter/HomeController on this server.

What am I doing wrong?

I'll probably have to remove the update I made to the httpd.conf file.

On another note, I tried using various answers from the following links with no success:

CodeIgniter htaccess and URL rewrite issues

CodeIgniter removing index.php from url

Codeigniter can't remove index.php

John Beasley
  • 2,577
  • 9
  • 43
  • 89
  • 1
    What Apache version are you using? The error you get is because of the "Deny for all" configuration. See here for a minimal working Apache configuration: https://symfony.com/doc/current/setup/web_server_configuration.html#apache-with-mod-php-php-cgi – solarc Apr 04 '19 at 16:35
  • 1
    The version of Apache is 2.4 – John Beasley Apr 04 '19 at 16:37
  • 1
    sorry, I'm confused as you write: private Windows 2008 server in the OP and in comments Apache 2.4. – Vickel Apr 04 '19 at 16:39
  • 1
    @Vickel My apologies. When I say private, I mean I am on an intranet. Sorry if the wording was incorrect. Question edited. – John Beasley Apr 04 '19 at 16:40
  • 1
    The key is what is your [Apache DocumentRoot](https://httpd.apache.org/docs/2.4/mod/core.html#documentroot)? If it is `d:/htdocs/codeIgniter`, then your `$config['base_url']` should just be `server01.usa.tests.com`. – Don't Panic Apr 04 '19 at 17:21

0 Answers0