由于.htaccess规则,php标头功能无法正常工作

时间:2022-01-30 08:49:02

Following are the contents from my .htaccess file:

以下是我的.htaccess文件中的内容:

RewriteCond $1 !\.(js|ico|gif|jpg|png|css|html|swf|mp3|wav|txt)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L,QSA]

I have following php code inside the index.php which checks page (i.e. myproject) and redirect requests:

我在index.php中有以下php代码,它检查页面(即myproject)和重定向请求:

header('Location:http://mynewsite.com/myproject/') ;
exit;

When i use www.example.com/myproject it should be redirected to mynewsite/myproject instead it is getting redirected to www.example.com/mynewsite.com/myproject

当我使用www.example.com/myproject时,应将其重定向到mynewsite / myproject,而不是将其重定向到www.example.com/mynewsite.com/myproject

Any idea what am i missing here ?

知道我在这里缺少什么吗?

1 个解决方案

#1


0  

Can you rewrite your header function as:

你可以重写你的标题函数:

header('Location: http://mynewsite.com/myproject/');
exit;

#1


0  

Can you rewrite your header function as:

你可以重写你的标题函数:

header('Location: http://mynewsite.com/myproject/');
exit;