我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在htaccess中重写页面名称

htaccess with php, I need to rewrite the below url

 freelancers.php?new=user

as

 register.php?new=freelancer

can any one help me out on this.

You can use this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} /register.php\?new=freelancer\s [NC]
RewriteRule ^ freelancers.php?new=user [R=302,L,NE]

RewriteCond %{QUERY_STRING} ^new=user$ [NC]
RewriteRule ^freelancers\.php$ register.php?new=freelancer [L,NC]

近期文章

  • 从openssl配置确定加密强度
  • php解析多个json文件,循环并在表中显示它
  • PHP Sql语句从MySQL导出表数据
  • 尝试上传图像时,base64_decode返回null
  • 根据物理位置限制特定页面访问
  • Windows服务器中PHP错误报告的奇怪行为
  • 如何在TemplaVoila FCE中使用php文件的输出?
  • 使URL不可读
  • PHP while($ x = mysql_fetch_array($ y))
  • PHP CLI:UTF8问题
  • 从浏览器隐藏API密钥
  • 在命名空间下使用AnnotationReader
  • 如何禁用cakephp中的选择框
  • 使用ajax和php将数据插入MySQL
  • Java:HTTP post多维数组
  • 如何为shopify oauth提供静态网址?
  • 在PhantomJS中使用seeElement()时出错
  • cURL替代方案,支持Rackspace Cloudsites的TLS
  • PHP:使用变量实例化类 - $ new = new $ _GET ['class_name'];
  • Laravel sync()方法错误

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华