开发者

Subfolders using htaccess

开发者 https://www.devze.com 2023-02-03 23:26 出处:网络
I want to have use something like this: http://localhost/test/dummy instead of this: http://localhost/test/profile.php?id=dummy

I want to have use something like this:

http://localhost/test/dummy

instead of this:

http://localhost/test/profile.php?id=dummy

I know that it can be done with URL Rewrite in .htaccess, but I don't know how exactly it works, so I can't make it work!

Can I anyone please help开发者_运维百科 me??


in your .htaccess file:

RewriteEngine on
RewriteBase /test
RewriteCond %{REQUEST_FILENAME} ! -f
RewriteCond %{REQUEST_FILENAME} ! -d
RewriteRule (.*) profile.php?id=$1

also read this: http://httpd.apache.org/docs/current/rewrite/rewrite_guide.html

0

精彩评论

暂无评论...
验证码 换一张
取 消