1

I know this question have more answer on this page. But It is not work fine for me. I don't know why. I followed step by step as instruction. Could you please help me check. Thanks for your support The URL looks liks is : examplemysite.com

The link work well if I add index.php for it.

  1. Change config.php -> $config['index_page'] = '';
  2. $config['uri_protocol'] = 'REQUEST_URI';
  3. htaccess is located same level with index.phpenter image description here

The content of htaccess

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

1 Answers1

0

In to enable mod_rewrite for Windows and Linux, do the following:

Windows:

  • Find and open the file .http.conf. This will be located in your Apache install folder.

  • Make a backup of http.conf which you can restore from, if anything were to go wrong

  • Find the line #LoadModule rewrite_module modules/mod_rewrite.so and remove the hash ‘#’enable-mod-rewrite-1

  • Locate the block within the directory tags as indicated below and change to: Options All AllowOverride All

  • Finally, restart apache server and your browser. The .htaccess rewriting should now be working.

Linux (Ubuntu as an example):

  • Activate the mod_rewrite module with

    sudo a2enmod rewrite

and restart the apache

sudo service apache2 restart

To use mod_rewrite from within .htaccess files edit the virtualhost

sudo nano /etc/apache2/sites-available/000-default.conf

Below “DocumentRoot /var/www/html” add the following lines:

<Directory “/var/www/html”>
AllowOverride All
</Directory>

Restart the server again:

sudo service apache2 restart
unixmiah
  • 3,081
  • 1
  • 12
  • 26