envexlabs Posted April 24, 2009 Share Posted April 24, 2009 Hey, I have an htaccess file that changes the sites variables based on which partner sites refer the traffic. So right now if sitea refers traffic, they point to this link: http://mysite.com/sitea/workouts the htaccess rule: RewriteRule ^([a-zA-Z0-9_-]+)/workouts workouts.php?site=$1 Everything is working fine except on the workouts page, all the images are no longer showing up because the file structure is: http://mysite.com/images/workouts/image.jpg I guess the htaccess rule is messing up with the structure because of the wildcard rule after the main .com. I've tried making a rule along the lines of: RewriteRule ^images /images/ But it doesn't seem to work. Am i missing a step? Thanks, envex (matt) Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/ Share on other sites More sharing options...
JonnoTheDev Posted April 24, 2009 Share Posted April 24, 2009 Dont use a rewrite for images. You need to set the path correctly in the img src element. if your images folder is under the root <img src="/images/image.jpg" /> not <img src="images/image.jpg" /> Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-818330 Share on other sites More sharing options...
envexlabs Posted April 24, 2009 Author Share Posted April 24, 2009 Hey, Thats the way it is right now. I think it's because of the first wildcard option as well as the workouts folder inside the images folder. The only images that aren't showing are the /images/workouts/image.jpg and it only happens when viewing, site.com/sitea/workouts All other images are displaying correctly. Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-818333 Share on other sites More sharing options...
JonnoTheDev Posted April 24, 2009 Share Posted April 24, 2009 Options +FollowSymLinks -MultiViews RewriteRule ^([a-zA-Z0-9_-]+)/workouts$ /workouts.php?site=$1 [L] Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-818341 Share on other sites More sharing options...
envexlabs Posted April 24, 2009 Author Share Posted April 24, 2009 Options +FollowSymLinks -MultiViews RewriteRule ^([a-zA-Z0-9_-]+)/workouts$ /workouts.php?site=$1 [L] You are a lifesaver! Thank you very much. envex (matt) Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-818345 Share on other sites More sharing options...
teshneh Posted August 1, 2012 Share Posted August 1, 2012 i have problem like envexlabs in this address : http://localhost/ostanehfars/NewAdvertise with this htaccess code: RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?Pages=$1 eveything is ok but when address change to : http://localhost/ostanehfars/NewAdvertise/success with this htaccess code : RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ index.php?Pages=$1&Act=$2 it don`t show my pictures!!! what can i do??? My Picture are in "Slices" folder in the root. please help me. Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-1365943 Share on other sites More sharing options...
JonnoTheDev Posted August 1, 2012 Share Posted August 1, 2012 Use an absolute path in your image src <img src="/Slices/image.jpg" /> Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-1365989 Share on other sites More sharing options...
teshneh Posted August 2, 2012 Share Posted August 2, 2012 Use an absolute path in your image src <img src="/Slices/image.jpg" /> no answer to me! thankyou for reply,see i explain more: all of my pages are in a folder with "Pages" name. The "index.php" is in the root and all of page load in index.php.my images path is like this: <img border="0" src="Slices/content2.gif" width="666" height="207"> what can i do? Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-1366220 Share on other sites More sharing options...
teshneh Posted August 3, 2012 Share Posted August 3, 2012 i find it,write here for other : RewriteRule ^(.*)/Slices/(.*)$ Slices/$2 Link to comment https://forums.phpfreaks.com/topic/155511-solved-htaccess-and-my-images-folder/#findComment-1366550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.