Php 我不能用重写规则重定向url

Php 我不能用重写规则重定向url,php,apache,.htaccess,http,url-rewriting,Php,Apache,.htaccess,Http,Url Rewriting,我想重定向url没有问号 所以, 这是行不通的 http://localhost/shorter/aQ3d4B 必须写入.htaccess文件的内容。请尝试以下操作: Options +FollowSymLinks RewriteEngine on RewriteRule shorter/(.*)/ ?$1 RewriteRule shorter/(.*) ?$1 这将给你一个$\u GET['id']在你的PHP中你能为我写代码吗?请输入一点.htaccess知识。如果你自己寻找,你会学

我想重定向url没有问号

所以,

这是行不通的

http://localhost/shorter/aQ3d4B
必须写入.htaccess文件的内容。

请尝试以下操作:

Options +FollowSymLinks
RewriteEngine on

RewriteRule shorter/(.*)/ ?$1
RewriteRule shorter/(.*) ?$1

这将给你一个
$\u GET['id']
在你的PHP中

你能为我写代码吗?请输入一点.htaccess知识。如果你自己寻找,你会学到更多。你看过上面评论中的网址了吗?它也为你提供了一个解决方案。我尝试了所有的方法,但我不能!这不是免费的Yavuz编码服务。你应该自己做腿部训练。如果你想有人写你所有的代码,有很多自由职业者你可以为这些东西付钱;对象不存在!在服务器上找不到请求中的URL。如果您手动输入了URL,请观察您编写的内容并重试。实际上,请将\d+转换为\w+,这只需要数字!不能与w+一起,你能来吗?
Options +FollowSymLinks
RewriteEngine on

RewriteRule shorter/(.*)/ ?$1
RewriteRule shorter/(.*) ?$1
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^shorter/(\w+)*$ ./shorter?id=$1