【发布时间】:2014-03-28 12:19:47
【问题描述】:
我已经在 .htaccess 文件中编写了 URL 重写代码。我想从 /CodecanyonSocial/settings.php 重定向到 /CodecanyonSocial/index.php?a=profile&u=username 所以我已经完成了重写的代码。但它不工作。这里 CodecanyonSocial 是 base(main) 文件夹(站点在 CodecanyonSocial 文件夹中)。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^CodecanyonSocial/index.php?a=profile&u=([A-Za-z0-9-]+)/?$ CodecanyonSocial/settings.php [QSA,L]
</IfModule>
【问题讨论】:
-
您希望在浏览器中显示的 URL 是什么?
-
你想从
/CodecanyonSocial/settings.php重定向到/CodecanyonSocial/index.php?a=profile&u=username。username在此重定向中的值在哪里? -
它在本地主机中,文件夹是 CodecanyonSocial
-
@user3131633:你还是没有回答我的问题
-
来自会话变量
标签: .htaccess url url-rewriting