重定向到其他页面时删除端口号

时间:2016-01-09 05:57:32

标签: php .htaccess redirect localhost

我正在使用PHP构建一个Web应用程序。然后我使用[NSData dataWithContentsOfURL:[NSURL URLWithString:imageURLString]];

将其设置为http://localhost:4040

我创建了一个登录模块,当用户重定向到仪表板页面时。重定向网址应为php -S localhost:4040但突然删除了端口号,我想知道为什么,网址结果为http://localhost:4040/userdashboard/index.php错误404。

http://localhost/userdashboard/index.php

建议非常感谢。 提前致谢

1 个答案:

答案 0 :(得分:-2)

这样设置" $ base_url =" localhost:4040 /&#34 ;; "然后在调用相同路径的地方使用$ base_url。 $ url =' /userdashboard/index.php'