Welcome Guest, Not a member yet? Register   Sign In
can't remove public index in codeigniter 4.1.7
#1

(This post was last modified: 01-21-2022, 09:07 PM by startup.)

PHP Code:
my config below
php Apache/2.4.41 (Win64OpenSSL/1.1.1c PHP/7.3.10/mod_rewrite

App
/app public $baseURL 'http://localhost:8080/ci4/publici4/';

public 
$indexPage '';

[
color=#222222][size=1][font=sans-serif]Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.10[/font][/size][/color]

[color=#222222][size=1][font=sans-serif]PHP Version 7.3.10[/font][/size][/color]

index.php
$pathsConfig 
FCPATH 'app/Config/Paths.php';

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

can someone  show to me why codeigniter dont remove index.php in url?
thank you in a advance

lixnus
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride ALL
Require all granted
</Directory>

window
<Directory "H:/HELPER/SERVER/AppServ/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
perfect remove index.php
Reply
#2

If your on Windows then you need to also do it in the .htaccess file like below.

Code:
# Remove index.php from URL
RewriteCond %{HTTP:X-Requested-With}    !^XMLHttpRequest$
RewriteCond %{THE_REQUEST}              ^[^/]*/index\.php [NC]
RewriteRule ^index\.php(.*)$            $1 [R=301,NS,L]

# place above this line in the .htaccess file
# redirect http:// to https://
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB