HTACCESS url not working

Hi please I have been having issues with my url htaccess code
I am trying to ensure that www.mydomain.com/index.php doesn’t show no more, instead it redirects to www.mydomain.com

Can anyone help me out here

Hi there. What directives do you have in your .htaccess file?

Options +FollowSymLinks 
RewriteEngine on 

RewriteBase /
RewriteRule ^(.*)index\.(html|php)$ http://%{HTTP_HOST}/$1 [R=301,L]

i also use this to remove the .html and .php extension but it doent work still

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html


</IfModule>

Ouch!

I can understand how reading the Apache documentation can gave a lot of “a what now?” moments, but that doesn’t look like any htaccess file I’ve ever seen.

This site might be easier for you?

In particular, the bit under “Extensionless Links” should help.

EDIT
Ah, you just posted some RerwriteCond lines while I was typing.
Less painful than the previous post.

haha right, let me check out the link you just posted, i hope it will be of great help

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.