3

I want to create a app url 'http://example.com'. But entering the url, it shows 'HTTP Error 403.14 - Forbidden'. when i have inserted 'index.php' at the last of url like 'http://example.com/index.php' the landing page is rendering in the browser I have changed the

$config['base_url'] = 'http://example.com';

$config['index_page'] = '';

and

$config['uri_protocol'] = 'REQUEST_URI';

in config.php file. Then i have placed the .htaccess file in the codeigniter root folder along with application and system folder. Then in the .htaccess file i have coded with

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

I just want to remove the 'index.php' from the url. I am using IIS 8.5 web server.

14
  • Sorry that i can't give you an exact answer due to not having any experience with IIS. But there are several answers listed here. And the second answer worked for me. stackoverflow.com/questions/1445385/… One more thing you might try though is editing the .htaccess a bit more "RewriteEngine on RewriteBase / RewriteRule ^(application|system|\.svn) index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [QSA,L]" Commented Jan 29, 2016 at 8:23
  • I already that way, but didn't work. Does apache and iis works in the same way Commented Jan 29, 2016 at 8:26
  • Seems not: stackoverflow.com/questions/25439087/… Try this then. It actually seems that you will also need URL Rewrite module and the spec (conf) will look different from apache. Commented Jan 29, 2016 at 8:28
  • What version of CI you using? Commented Jan 29, 2016 at 8:31
  • I edited the .htaccess with your code "RewriteEngine on RewriteBase / RewriteRule ^(application|system|\.svn) index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [QSA,L]" and o/p is the same "HTTP Error 403.14 - Forbidden" Commented Jan 29, 2016 at 8:31

3 Answers 3

1
  htaccess file
  RewriteEngine on
  RewriteCond $1 !^(index\.php|resources|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]

  my site is working http://demo.crowdfundingscript.com/ 
  config file
  $config['uri_protocol']   = 'AUTO';
   $config['index_page'] = '';
Sign up to request clarification or add additional context in comments.

1 Comment

Still the same error shows. Do i have change the index.php file in the root
0

Replace this line:-

$config['uri_protocol'] = 'REQUEST_URI';
to
$config['uri_protocol'] = 'AUTO';

also change your base url as below.

$config['base_url']    = 'http://'.$_SERVER['HTTP_HOST'].'/';

Write your rules as below:

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

Hope it will work for you :)

2 Comments

It also resulted the same.
why changing "$config['uri_protocol'] = 'REQUEST_URI';" to "$config['uri_protocol'] = 'AUTO';"
0

In config.php,

remove index.php in $config['index_page']

For ex :

$config['index_page'] = '';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.