Merdok Posted March 21, 2010 Share Posted March 21, 2010 ok thanks to the help I've had on this forum and Google I've got pretty much everything rewritten on my site now, there is just one more thing that is causing me an issue. I want it so my various modules image directories are hidden and instead point to a virtual directory in the root. eg: if someone types in /articleimages/imagename.jpg it will point to /admin/module/module/images/imagename.jpg I've tried to figure it out myself but it is not working at all. Here is my effort: RewriteRule ^articleimages/?$ /admin/modules/module/images/$1 but when I test it, nothing happens. Could someone please tell me what I'm missing? Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/ Share on other sites More sharing options...
MadTechie Posted March 21, 2010 Share Posted March 21, 2010 try thus RewriteRule articleimages/(.*$) /admin/modules/module/images/$1 is /admin/modules/module/images in the public domain ? Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/#findComment-1029662 Share on other sites More sharing options...
Merdok Posted March 21, 2010 Author Share Posted March 21, 2010 Bingo Thank you so much Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/#findComment-1029664 Share on other sites More sharing options...
MadTechie Posted March 21, 2010 Share Posted March 21, 2010 Welcome you just needed the capture () really Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/#findComment-1029667 Share on other sites More sharing options...
Merdok Posted March 21, 2010 Author Share Posted March 21, 2010 Right that definately works when called via http but I have a bit of a problem, I use phpThumb to read some images in and if I set the image url to /articleimages/imagename.jpg then I get: /home/sites/digitalfusiondev.me/public_html/articleimages/imagename.jpg does not exist I'm not sure if there is something that can be fixed using mod_rewrite or something that needs changing in phpThumb. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/#findComment-1029680 Share on other sites More sharing options...
MadTechie Posted March 21, 2010 Share Posted March 21, 2010 as its reading from the server path a rewrite won't apply, maybe use a symbolic link instead //1. remove the articleimages folder symlink('/admin/modules/module/images', 'path-containing-articleimages/articleimages'); Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/#findComment-1029698 Share on other sites More sharing options...
Merdok Posted March 21, 2010 Author Share Posted March 21, 2010 Wow I'd never even heard of symlinks in PHP before Thank you very much, you've no idea how much you've helped me tonight Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/#findComment-1029705 Share on other sites More sharing options...
MadTechie Posted March 21, 2010 Share Posted March 21, 2010 Your very welcome , I'm glade I could help Quote Link to comment https://forums.phpfreaks.com/topic/196028-replace-multiple-directories-with-one-virtual-directory/#findComment-1029731 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.