.htaccess ReWrite wildcard folder paths from host
Posted
by
JHuangweb
on Pro Webmasters
See other posts from Pro Webmasters
or by JHuangweb
Published on 2013-09-25T18:47:14Z
Indexed on
2013/10/26
10:14 UTC
Read the original article
Hit count: 224
htaccess
|mod-rewrite
My desired result is change a file to root / from a N number of paths.
For example:
www.host.com/a/b/c/e/f/g/images/1.jpg
, where A~G
is not always given.
Result:
www.host.com/images/1.jpg
This is what I have so far:
www.host.com/a/images
--> www.host.com/images
Using: RewriteRule ^a\/images/$ images/$1 [L]
What I need is a wildcard in front of /images/
Like this: RewriteRule ^*/images/$ images/$1 [L]
How can I do this correctly in .htaccess?
© Pro Webmasters or respective owner