我今天在WolframAlpha.com上亂搞,並注意到你開始在wolframalpha.com/index.html頁面,然後當你點擊enter
時,你會被重定向到wolframalpha.com/input/?i = YourSearchPHP URL /?val = something
我知道如何設置的,<form action="newpage.php" method="GET" />
但我工作的項目,這將是冷靜,如果我可以重定向到example.com/?val=something
而不是example.com/newpage.php?val=something
是否有可能重定向到一個文件,但在頁面像WA這樣隱藏的名字有?這會成爲.htacess的工作嗎?
編輯: 我需要直接從index.php來頁/ file.php沒有「file.php」顯示在瀏覽器的URL設置。所以,如果我說:
<form action="pages/file.php" method="GET">
<input type="text" name="foo" />
</form>
那麼,如果將直接我example.com/?foo=blah代替example.com/pages/file.php?foo=blah
它通常正好相反:在'.htaccess'中你指定URL重寫規則,所以'example.com /'被處理爲'example.com/some_new_php.php'。 – raina77ow
如果未指定文件名稱,則所引用目錄的相應「index.php」將收到請求;以Apache設置爲例。 – mario