Localhost localhost localhost 500 error

I am starting a new project in codeigniter. When setting up the working folder in localhost, I put the following htaccess file in the project root folder to remove index.php from the URL

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

now i get the error as follows

"Internal server error

The server detected an internal error or incorrect configuration and was unable to fulfill your request.

my project path is localhost / sc

in the config.php file I will put the following line

 $config['base_url']='http://localhost/sc';

Server error message: "Invalid" RewriteEngine "command, possibly with an error or determined by a module not included in the server configuration"

I am using a wamp server on a Windows platform please help me solve this problem.

thanks

+4
6

.htaccess script . . , index.php

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

500 apache error.log, /var/log/apache 2/error.log

.

+7

: .htaccess: 'RewriteEngine', , ,

, mod_rewrite. " Invalid command 'RewriteEngine'.

, /sc/, /sc/:

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

htaccess /sc/.

+4

rewrite_module WAMP. .

+3

.

  • , , mod_rewrite Apache. .
  • -, - htaccess. , htaccess.

Options +FollowSymlinks 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
Hide result
+2

CodeIgniter, , , , 500- .

0

Activate Rewrite_module in wampserver Like Apache β†’ Apache Modules β†’ Rewrite_module [Just select] Or else See β€œApache Error Log” on the Apache menu in wampserver to learn more about the error

0
source

All Articles