Hello Experts I wanna implement URL rewrite mode as such URL = http://dir.netpowersoft.com/Arts/Animation/Technical_Process/ (Note /Arts/Animation/Technical_Process/ these are not directories) Re-Written as = http://dir.netpowersoft.com/index.php?arg=Arts/Animation/Technical_Process/ Currently I am using .htaccess as:- Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteRule /(.*) /index.php?arg=$1 Code (markup): *** But with this code images are not loading on. I am stuck now !!! Any help be appreciated ... Thanks for your time
Try avoiding relative path to images. You may use like <img src="/image_folder/smile.gif" alt="" width="xx" height="xx" />
Have the image code as if the mod_rewrite URLs are the real URLs. The browser has no idea you're using mod_rewrite!!!!
@Vishwaa I can't use "/images/logo.gif" as at site index it will be http://dir.netpowersoft.com/images/logo.gif (OK here) but at inner pages like http://dir.netpowersoft.com/Arts/ it will be (http://dir.netpowersoft.com/Arts/images/logo.gif) (Not OK) So i have to make them complete URL !!! @Nintendo I really don't understand what you mean to say !!! can you explain it more with example codes or RewriteRule ?
Hi, That's not correct. If you use "image_folder/smile.gif", - at site index it will be http://dir.netpowersoft.com/image_folder/smile.gif (OK here) - at inner pages like http://dir.netpowersoft.com/Arts/ it will be (http://dir.netpowersoft.com/Arts/image_folder/smile.gif) (Not OK), but if you use "/image_folder/smile.gif", - at site index it will be http://dir.netpowersoft.com/image_folder/smile.gif (OK here) - at inner pages like http://dir.netpowersoft.com/Arts/ it will be (http://dir.netpowersoft.com/image_folder/smile.gif) (OK too). Jean-Luc
@Jean-Luc that's alright Anyways my problem is images not loading (no matter there path is correct or not ) !!! even if i use ("/images/logo.gif") Is it because of htaccess ? and how can i fix it ? thanks for your time !!!
Is http://dir.netpowersoft.com/images/logo.gif the URL of the image? If so, mod_rewrite is making it look like a directory!!! Top > images > logo.gif Try Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)$ index.php?arg=$1 [L] and if that doesn't work, try RewriteRule ^dir/([^.]+)$ index.php?arg=$1 [L] with all the URLs having dir/ in them.
everthing goes fine until i have .... new problem .htaccess file code :- Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)$ index.php?arg=$1 [L] Code (markup): this code also redirect http://dir.netpowersoft.com/admin/ to index.php, how can i stop redirection?
BEFORE the above RewriteRule, add RewriteRule ^admin/ - [L] Code (markup): and RewriteRule ^admin$ /admin/ [R=301,L] Code (markup): I'm not sure if you need a slash between "^" and "admin" in both. Anyway, the first stops redirection of anything under the admin foler, and the latter one makes sure that if "admin" does not have a trailing slash (as in "www.aaa.com/admin" instead of "www.aaa.com/admin/"), that the slash is added. I think that's right. Try messing about a bit if they don't.