我有一些麻煩理解.htacess基本上我試圖有多個重寫規則;例如我有一個配置文件頁面,然後我也想重寫索引頁面,那麼這將如何完成;在我以前的嘗試中,我只能使用一個重寫規則,也許我做錯了什麼;我有一個鏈接/profile/profile.php?user=$username
和索引頁面account.php?page=featured
的個人資料頁面我怎樣才能讓個人資料頁面看起來像/account/$username
和帳戶頁面看起來像/account/featured
謝謝你,我怎麼會然後添加更多的後面呢?多個htacess重寫規則
account.php文件位於根目錄下。
RewriteEngine On
RewriteBase/
RewriteRule ^tag/([^/]+)/([^/]+)$ /tag/index.php?hash=$1&cat=$2
Options All -Indexes
ErrorDocument 403 Denied
是它使用#標籤,並顯示他們喜歡這個/tag/$hashtag
當我試圖複製並粘貼這然後在它使用它沒有工作我目前的.htaccess。
發表您的當前代碼 –
@ImmortalDude做過了:3 – Johnny
Apache將無法知道需要重寫哪個文件。也許用'/ profile/username'替換'/ account/username'並編寫規則來保持它們的分離。或者,更好的是,'/ account/username/profile'。 –