.htaccess文件工作,但不能重写url

The time has come to hide the get variables, but my .htaccess file wont allow the rewrite.I currently have this:

RewriteEngine On
RewriteRule ^timeline/(\d.*) timeline.php?user=$1

It is timeline.php?user=chris and it must read timeline.php

I have looked for close to 2 hours, copying and changing code, but nothing works.

I have also changed

<Directory ..>
...
AllowOverride None
...
</Directory>

to:

AllowOverride All

Please help!

Use following htaccess and try

RewriteEngine On
RewriteRule ^timeline/([^/]*)$ /timeline.php?user=$1 [L]

try this:

RewriteRule ^timeline/(.*)$ timeline.php?user=$1

I believe you need to turn off MultiViews option by putting line on top of your .htaccess:

Options -MultiViews
  • Option MultiViews is used by Apache's content negotiation module that runs before mod_rewrite and and makes Apache server match extensions of files. So /file can be in URL but it will serve /file.php.