如何在php中从url中删除文件夹名称?

时间:2016-10-24 07:20:29

标签: php html5 .htaccess

我创建了index.php文件并给出了标题,即

<?php

header('location:/cicareer/members');

?>

网址是:

careermate.in/cicareer/members

我想删除

/cicareer/members

那么,我怎么能用.htaccess文件呢?

1 个答案:

答案 0 :(得分:0)

此行可能有助于您的.htaccess文件

RewriteRule ^index.php$ /cicareer/members/index.php

为了使用它,您需要在httpd.conf中启用mod_rewrite模块