2012-10-23 71 views
0

我今天在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

+0

它通常正好相反:在'.htaccess'中你指定URL重寫規則,所以'example.com /'被處理爲'example.com/some_new_php.php'。 – raina77ow

+3

如果未指定文件名稱,則所引用目錄的相應「index.php」將收到請求;以Apache設置爲例。 – mario

回答

0

如果index.php是如果您訪問www.example.com/,則在該頁面上使用<form action="">的表單將加載該腳本將執行此操作。

相關問題