简体   繁体   中英

Trying to remove directory names from application URL

My badluck I'm a UI developer and given the task of URL rewriting please help me.

I've this URL with me /abc/def/ghi/somefile.php?id=1 I want it to just somefile?id=1

I do have this code in my .htaccess

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteRule ^/abc/def/ghi/(.*)$ /$1 [L,NC,R]

but after uploading the htaccess to server this is giving me 404 error after removing the /abc/def/ghi/ part.

Any help is greatly appreciated.

RewriteRule not receive first slash

RewriteRule ^abc/def/ghi/(.*)$ /$1 [L,NC,R]

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