Welcome Guest, Not a member yet? Register   Sign In
Problems Getting rid of index.php from URL
#1

[eluser]Oussama M Billah[/eluser]
Hello,

I followed the user guide instructions to remove the index.php from the URL but I get a 500 Internal server error when creating the .htaccess file.
that i have in the .htaccess file

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I looked at other solutions in the forum but was not able to get it to work?

I m working on a windows machine running apache 2.2

Any help?

Thanks
Oussama
#2

[eluser]Oussama M Billah[/eluser]
Any help?
#3

[eluser]n0xie[/eluser]
Did you check if mod_rewrite is loaded?
#4

[eluser]cahva[/eluser]
You can look at the http-error log file to see what is wrong(you'll see from there a more detailed error).
#5

[eluser]Clooner[/eluser]
Try this .htaccess
Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>
#6

[eluser]skunkbad[/eluser]
My .htaccess

Code:
RewriteEngine On
RewriteBase /
RewriteRule ^(system|cgi-bin) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
#7

[eluser]Oussama M Billah[/eluser]
Thanks for your replays

When I try Clonner's Htaccess file , I get the following error msg:

[Mon Aug 31 16:02:02 2009] [error] [client 127.0.0.1] File does not exist: D:/wamp/www/clothing/catalog, referer: http://localhost/clothing/


and when i try anskunkbad htaccess file I get the followng error:

D:/wamp/www/clothing/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

n0xie, How do I check if mod_rewrite is loaded?


Thanks in advance.
Oussama
#8

[eluser]Clooner[/eluser]
It doesn't know the command RewriteEngine and therefor I assume mod_rewrite is not installed. Did you enable it? (On how to do this, I suggest to use a thing called google.)
#9

[eluser]Oussama M Billah[/eluser]
I did google and enabled it, now I get a 404 page not found error

Thanks
#10

[eluser]skunkbad[/eluser]
When you get the page not found error, you might need to change a configuration setting "uri_protocol" inside config/config.php. Try changing this to one of the other options, and see what happens. For instance, on my production server, the setting must be changed to "REQUEST_URI".




Theme © iAndrew 2016 - Forum software by © MyBB