English 中文(简体)
重定向带有参数且不扩展页的页面
原标题:redirect a page with parameters and without page extension

我需要重定向像这样的一页:

http://example.com/clients/themes?domain=localhost.com

此链接应该被重定向到同一目录中的皮肤.php。

有人能帮我吗?

最佳回答

通过 httpd.conf 启用mod_rewriter和.ht access,然后将该代码输入您的 .ht access DOCUONT_ROOT 目录:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^domain=localhost.com$ [NC]
RewriteRule ^clients/themes/?$ clients/skin.php? [L,NC]

这将在内部将您的请求转发到 /clients/skin.php 剥离查询字符串。 如果您也想要查询字符串, 那么在 skin.php 之后删除 < code>? 。

问题回答

暂无回答




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签