Can't configure 'remove index.php' |
Hi,
I just can't succeed in removing index.php . I googled, found many references to this, unsuccessful. I also search the forum, loads of posts, again without success. The codeigniter directory is under /var.
Within all pages I read, I just can't find the right procedure. What is it ? Thanks
Hi Ayrese,
here we go. In /var/codeigniter/application (not edited) <IfModule authz_core_module> Require all denied </IfModule> <IfModule !authz_core_module> Deny from all </IfModule> In /var/codeginiter <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> In /var/www asaasasasasasasasasasasas RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] In /var/www/html asaasasasasasasasasasasas RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] Thanks for your help.
Put your .htaccess file in the same folder as index.php
My version: Code: <IfModule mod_rewrite.c> In my config.php: PHP Code: $config['base_url'] = 'http://www.my-domain.com/'; //example!
Hi Wouter60,
tried your suggestion, but it still doesn't work. I added garbage at the beginning of the .htaccess file to get an error, but didn't get it, so that .htaccess file is not read I guess. In a browser I get a 404 "The requested URL /wactrl was not found on this server." when I type http://cdesys.dlinkddns.com:180/wactrl For sure wactrl is not in the /www/html directory. If I add index.php, all is well.
If the garbage you added at the beginning of .htaccess is not producing an error that would tend to indicate the either mod_rewrite is not active or that .htaccess is not in the correct place. .htaccess should be in the same directory as index.php
You can view loaded apache modules by using the linux command console and the command apache2ctl -M Look for rewrite_module in the list that appears.
Hi Dave,
from https://docs.bolt.cm/3.0/howto/making-su...cess-works I got the clue to check if Apache configuration enables .htaccess. In fact that was turned of. I changed this in apache2.conf: Code: <Directory "/var/www/htdocs"> I changed None to All and got some results. The first .htaccess file accessed is in /var/www, and the second one is in /var/www/html. But then I get the AH00124 error: exceeded the limit of 10 internal redirects. Looks like it's lost somewhere in the forest. Having rewrites to log to level3, I learned that the server loops doing rewrite until the limit is reached. On top of that, the rewrite is done wrong at the beginning: Code: strip per-dir prefix: /var/www/html/wactrl -> html/wactrl Right after this, all of this is done again until the limit is reached. As far as I understand, the URI from the received is /var/www/html/wactrl, where wactrl is the controller name. Once edited, that should become /var/www/html/index.php/wactrl right ? But it does not. What is wrong ? And why is there a loop inside /var/www ? EDIT ON October 20th Finally made it work. The problem was the RewriteRule. I changed it to: Code: RewriteRule html html/index.php Then /var/www/html/wactrl is changed to /var/www/html/index.php/wactrl In short RewriteRule line is:[img]file:///Desktop/regex.jpg[/img] RewriteRule SearchExpression ReplaceExpression where SearchExpression is the part of the URI to be replaced by ReplaceExpression. This is the short story because both expression can use regular expression. If you wish to test what you need, go https://regex101.com/ You can test drive your expressions live until you are satisfied. A screen shot is attached. Thanks |
Welcome Guest, Not a member yet? Register Sign In |