【问题标题】:Url routing not working in my PHP code网址路由在我的 PHP 代码中不起作用
【发布时间】:2017-01-24 23:23:06
【问题描述】:

我的 .htaccess 代码 它仍然在链接中显示文件名(http://localhost/examp/myproj(urlrouting)/signup.php) 但是在点击注册时,我希望链接是(http://localhost/examp/myproj(urlrouting)/SignUp) 使用 xampp

RewriteEngine On    
 # Redirect Trailing Slashes...

RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^index index.php            

#RewriteRule ^test/([(A-za-z0-9)]+) test.php?test=$1        

RewriteRule ^SignUp signup.php          

【问题讨论】:

    标签: javascript php html css web


    【解决方案1】:

    在您的 .htaccess 文件中使用以下内容应该可以完成您想要做的事情。

    RewriteEngine On    # Turn on the rewriting engine
    RewriteRule    ^SignUp/?$    signup.php    [NC,L]    # Handle requests for "SignUp"
    

    【讨论】:

      猜你喜欢
      • 2012-06-24
      • 1970-01-01
      • 1970-01-01
      • 2019-05-03
      • 2017-02-02
      • 2019-11-06
      • 2018-11-28
      • 2014-01-25
      • 2017-08-11
      相关资源
      最近更新 更多