0

I added this line to: /etc/apache2/apache2.conf

AddType application/x-httpd-php .php .php3 .php4 .html

so it treats my html files as php. But now when I add a slash / after any url, the page comes up without any images.. I asked this question and a user gave a suggestion to fix the issue through .htaccess, and it did. But when adding the above line the issue of not showing images comes back.

Community
  • 1
  • 1
Mike
  • 2,051
  • 4
  • 28
  • 46
  • @JonLin's [answer](http://stackoverflow.com/a/18578247/67332) is the perfect solution for previous and this question. If you wrote local files in absolute path, they will work. – Glavić Oct 12 '13 at 15:50

1 Answers1

0

Ok now you're facing the most common problem people face when switching to pretty URL schemes. Solution is also simple, just use absolute path in your css, js, images files rather than a relative one. Which means you have to make sure path of these files start either with http:// or a slash /.

Alternate solution is to use BASE tag

For ex is your images base path is /images/:

<base href="/images/">
anubhava
  • 761,203
  • 64
  • 569
  • 643