I am trying to find a solution to truncating the URL instead of showing - http://mywebsite.com/main/android.php?dir=.%2Fandroid it should show: http://mywebsite.com/main/android/android.php
1条回答 默认 最新
dongzhan7909 2017-04-07 14:05关注Not sure whether you really want to that in PHP. What you can do is using the .htaccess file to provide such a url transformation.
Otherwise you could do something like this:
if (isset($_GET['dir'])) { $dir = $_GET['dir']; header('Location: ' . $dir . '/android.php'); }解决 无用评论 打赏 举报