隐藏文件扩展名和php获取URL中的变量

I have URL like this :

http://domain.net/news.php?url=/abcd.html

I need strip .php?url= to URL like this:

http://domain.net/news/abcd.html

Just tried :

  1. Modify .htaccess file : RewriteRule ^news/(.*) news.php?url=$1 [L,QSA]
  2. Put strtok in news.php :

    $url=strtok($_SERVER["REQUEST_URI"],'?');

But it not work, in root folder, Drupal CMS running, that mean file index.php handle everything.

My .htaccess file here : http://pastebin.com/xktzt0yc

Please help!

If I understood correctly, your pattern and substitute is mixed. Have you tried to switch the pattern and substitute?

RewriteRule news.php?url=(.*) ^news/$1 [L,QSA]