我有一個頁面名稱page.php
和我的網址爲localhost/mysite/page.php
,我現在該怎麼可以用.htacess
文件的URL更改爲localhost/mysite/somethinghere1/somethinghere2/page.php
變更網址.htacess PHP
它嘗試使用下面的代碼,但它不工作了。
<IfModule mod_rewrite.c>
# Enable Rewriting
RewriteEngine On
# Rewrite user URLs
# Input: user/NAME/
# Output: user.php?id=NAME
RewriteRule ^somethinghere1/somethinghere2/.php? page.php
</IfModule>
我該如何實現這一目標。
我編輯了這個問題,我也檢查你的解決方案,但它沒有解決。 – Rafee
@Rafee:更新了我的答案 –
我得到了這個,但我需要'localhost/mysite/page.php' url更改爲'localhost/mysite/something1/something2/page.php',並且我正在尋找對於。 – Rafee