tags:

views:

9

answers:

1

Hello,

Here is the .htaccess entry. what I intended to do is to transfer anyone typing as www.yahoo.com/Hello to www.yahoo.com/index.php?h=hello.

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule /index.php?u=$1

Now for some reason it shows me a 404 error when I type in yahoo.com too, I wonder what is wrong.

Thanks Jean

A: 

Try this:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

Line 2 and 3 will apply a condition to the RewriteRule to make sure it doesn't redirect if the requested URL is a valid file or directory.

ILMV
Will it work on the local server that is http://localhost/test ?
Jean
As long as you have the apache module `mod_rewrite` installed and enabled it should work.
ILMV