duanbenzan4050 2012-05-24 12:00
浏览 12
已采纳

使用参数重定向页面而不使用页面扩展名

I need to redirect a page like this:

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

this link should be redirected to skin.php which is in the same directory.

Can any one help me? Thanks.

  • 写回答

1条回答 默认 最新

  • doujianzi8521 2012-05-24 12:07
    关注

    Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

    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]
    

    This will internally forward your request to /clients/skin.php stripping out query string. If you want query string as well then remove ? after skin.php.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 nginx的使用与作用
  • ¥100 关于#VijeoCitect#的问题,如何解决?(标签-ar|关键词-数据类型)
  • ¥30 数字信号处理实验报告
  • ¥15 一个矿井排水监控系统的plc梯形图,求各程序段都是什么意思
  • ¥15 ensp路由器启动不了一直报#
  • ¥50 安卓10如何在没有root权限的情况下设置开机自动启动指定app?
  • ¥15 ats2837 spi2从机的代码
  • ¥200 wsl2 vllm qwen1.5部署问题
  • ¥100 有偿求数字经济对经贸的影响机制的一个数学模型,弄不出来已经快要碎掉了
  • ¥15 数学建模数学建模需要