从 htaccess 获取符号值

Getting value with symbol from htaccess

这个url

example.com/ad/load.php?id=pay.jpg

会变成

example.com/ad/pay.jpg

我试过这样做..但它不起作用。 这是我的 htaccess(进入 ad 文件夹)

Options +FollowSymLinks
RewriteEngine On
RewriteBase /ad/

RewriteRule ^(\w+) ./load.php?id=

编辑

在这个根 example.com/ad/ 上我想显示 index.php 但它没有显示。如何解决

你的正则表达式也应该允许点。在 /ad/.htaccess 试试这个:

DirectoryIndex index.php
Options +FollowSymLinks
RewriteEngine On
RewriteBase /ad/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([\w.-]+)/?$ load.php?id= [L,QSA]