简体   繁体   中英

Rewrite file url using htaccess

This is the path to a directory which stores images of all the users:

localhost/demo/images/imagedb/user/ xyz.jpg

Instead of showing all the directory names and actual path, I want to display the image in the directory like this:

localhost/demo/userdp/ xyz.jpg

I tried the following code but it did not work and gave me error

RewriteEngine On
RewriteRule   ^demo/images/imagedb/user/(.+)$   demo/userdp/$1   [L]

Could you provide me with a solution?

The URL to be entered goes first, like this:

RewriteEngine On
RewriteRule   ^demo/userdp/(.+)$   demo/images/imagedb/user/$1   [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