[英]url routing from root with index.php and htaccess in sub-directory
[英]with .htaccess file using sub-directory with root to re-write url in PHP and XAMPP
我在Windows上運行XAMPP Server V. 3.2.1。 我有具有以下代碼的.htaccess文件:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ /?cmd=$1&caseSno=$2 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/?$ /?cmd=$1 [NC,L]
它在url中有兩個參數對我來說工作正常,並且可以重寫我的
?cmd=page_name&id=34
像這樣
localhost/home/34
現在,我正在嘗試訪問位於子目錄中的其他頁面。 我的目錄結構在這里:
Please view the following image for directory structure
請幫助我,我是.htaccess的初學者
提前致謝
將此規則放在/court_Admin/courtUsers/.htaccess
:
RewriteEngine On
RewriteBase /court_Admin/courtUsers/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/?$ ?cmd=$1 [QSA,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.