简体   繁体   中英

with .htaccess file using sub-directory with root to re-write url in PHP and XAMPP

I am running XAMPP Server V. 3.2.1 on my windows. I have .htaccess file having the following code:

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]

It working fine for me with two parameters in url and can rewrite my

?cmd=page_name&id=34

like this

localhost/home/34

Now, i am trying to access my other pages which are situated in subdirectory. structure of my directory is here:

Please view the following image for directory structure

在此处输入图片说明

Please help me in this i am beginner with .htaccess

Thanks in advance

Place this rule inside /court_Admin/courtUsers/.htaccess :

RewriteEngine On
RewriteBase /court_Admin/courtUsers/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/?$ ?cmd=$1 [QSA,L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM