URL可以在localhost上正常工作,而不能在Web服务器上工作 [英] URL perfectly working on localhost, not working on web server

查看:132
本文介绍了URL可以在localhost上正常工作,而不能在Web服务器上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了此处发布的其他解决方案,但没有任何效果。

I've tried other solutions posted here, but nothing worked..

我在.htaccess文档上有以下代码。

I have the following code on .htaccess doc.

RewriteEngine On
RewriteRule ^registrationForm/([a-zA-Z0-9_-]+)$ registrationForm.php?code=$1
RewriteRule ^registrationForm/([a-zA-Z0-9_-]+)/$ registrationForm.php?code=$1

我收到一封电子邮件,然后单击url,就可以访问registrationForm.php

I receive an email and by clicking on the url I get access to registrationForm.php

我像这样启动registrationForm.php:

I start registrationForm.php like that:

<?php
if (!empty($_GET['code']) && isset($_GET['code']))
{
    $code=$_GET['code'];

有人知道为什么它可以在本地主机上运行但不能在远程服务器上运行吗?

Do someone knows why this works on localhost but not on remote server?

推荐答案

问题不是您在获取代码时如何运行代码。问题可能在这里发生。

The problem is not how you got the code running in acquiring the code. The problem could have occurred here.

if (!empty($_GET['code']) && isset($_GET['code']))
{
    $code=$_GET['code'];

上面的代码行无法获取代码部分,它是查询字符串的一部分。生成的查询字符串中没有单词 code 。您可能需要阅读此文章

The line of code above was not able to get the code part which is part of your querystring. The querystring that has been generated doesn't have the word code in it. You may want to read this article.

这篇关于URL可以在localhost上正常工作,而不能在Web服务器上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆