htaccess not working - have tried everything on forum-newbie |
[eluser]lollylegs[/eluser]
If I type http://localhost/codeigniter/index.php/welcome I get the welcome page. If I type http://localhost/codeigniter/welcome I get url cannot be found on this server This is my .htaccess file which is located in folder with index.php DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ./codeigniter/index.php/$1 [L,QSA] I have my codeigniter folder in my apache/htdocs folder (I know this is not secure, but that is another problem I will tackle when I solve my .htaccess problem. The Rewrite module is loaded eg mod_rewrite.so, but because I'm using apache on windows that perhaps I should load a .dll instead. I also tried to change the directive Allow Override to ALL but get an internal server configuration error <Directory "C:/webserver/apache/htdocs"> Options Indexes FollowSymLinks # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> I would appreciate any help Regards Marea Australia
[eluser]outrage[/eluser]
Make sure you change this: $config['index_page'] = "index.php"; to this: $config['index_page'] = ""; in your config.php
[eluser]axpen[/eluser]
Code: <Directory "c:/wamp/www/"> Mine looks like that. I don't know why override all wouldn't work. I believe that Apache relies on Overrides to do htaccess, so with override none, your htaccesses shouldn't work at all. I would set that to all then try to track down your error, or post it and that part of your log file here. Code: <IfModule mod_rewrite.c> That's the way my .htaccess reads. It's usually a good idea to IfModule so you don't try to redirect without mod_rewrite loaded. Mind you if you were to use Linux mod_rewrite.c becomes mod_rewrite.so. I think the problem lies in the "./codeigniter/index.php/$1" portion. If you have the .htaccess in http://localhost/codeigniter/.htaccess then you are requesting a redirect to http://localhost/codeigniter/codeigniter/index.php/$1. See if sticking my htaccess code (modify my RewriteCond to match yours first) in http://localhost/codeigniter/.htaccess will work for you. If not, try to fix your httpd.conf file. Also as pistola mentions, every time you make a change to your httpd.conf you MUST restart Apache to see the changes. This does not apply to .htaccess though of course. Hope this helps, --Alex
[eluser]Unknown[/eluser]
yup i have same problem like this, and has solved..Thanks axpen. |
Welcome Guest, Not a member yet? Register Sign In |