Remove index.php from codeigniter in xamp

前端 未结 7 918
名媛妹妹
名媛妹妹 2021-01-21 07:11

I\'ve tried quite a few answers but keep coming up against the good ol, 404 wall of terror. I\'m on Windows 7 using a xamp stack. mod_rewrite is enabled.

I put the htacc

相关标签:
7条回答
  • 2021-01-21 07:42

    Firstly, enable "rewrite module' of apache in XAMPP

    If you are using XAMPP or WAMP package then you will find the file at:

    {xampp_dir}/apache/conf/httpd.conf
    {wamp_dir}/apache/conf/httpd.conf
    

    Find following line and remove the ‘#’ sign.

    LoadModule rewrite_module modules/mod_rewrite.so
    

    Actually, we can do upper by XAMPP popup menu: Apache -> Apache Modules -> rewrite module, and select it so as to enable it.

    Secondly, we need change the htaccess by following:

    RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^(.*)$ index.php/$1 [L]
    
    0 讨论(0)
  • 2021-01-21 07:48

    first create .htacess file and paste below code in that RewriteEngine on

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

    then go to config file

    $config['index_page'] = 'index.php';
    

    change to

    $config['index_page'] = '';
    

    and enjoy

    0 讨论(0)
  • 2021-01-21 07:57

    Also try changing your request method in your config file from AUTO to REQUEST_URI.

    0 讨论(0)
  • 2021-01-21 07:58

    Try this:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    $config['index_page'] = 'index.php';
    

    change to

    $config['index_page'] = '';
    
    0 讨论(0)
  • 2021-01-21 08:06

    have you enabled the mod_rewrite in apache?

    0 讨论(0)
  • 2021-01-21 08:06

    Try changing the last line of your htaccess to:

    RewriteRule .* index.php/$1 [L] 
    
    0 讨论(0)
提交回复
热议问题