Luhana
Luhana

Reputation: 11

.htaccess image display problem

htaccess file to redirect my pages like

site/pageTitle to index.php?id=pt

and to show article from category site/article/pageTitle

now .htaccess file considering my image folder as catgory directory and images as pageTitle and does not display images even when I direct url to image it shows article page

Options +FollowSymlinks
RewriteEngine on


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


#show urls like site/author/pageno

RewriteRule ^author/(.*)/(.*)$  index.php?author=$1&page=$2 [NC]
RewriteRule ^author/(.*)?$  index.php?author=$1&page=$2 [NC]

#show articles like site/article/articleTagName

RewriteRule ^article/(.*)/(.*)?$  index.php?article=$1 [NC]
RewriteRule ^article/(.*)?$  index.php?article=$1 [NC]


#direst article  site/articleTagName
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?article=$1 [L,QSA] 



#set image folder and user folder to real from virtual
RewriteRule ^(.*)/images/$ /images/

Upvotes: 1

Views: 1291

Answers (1)

Shahzab Asif
Shahzab Asif

Reputation: 11

Please replace your last line with

RewriteRule ^(.*)/images/(.*)$ images/$2

I was facing the same problem but I got a hint from your coding and changed the code a little bit; now it's working fine.

Upvotes: 1

Related Questions