Sorry the hierarchical directory structure didn't display correctly:
blog
|---->html
------|--->images
------|--->css
------|--->js
------|--->index.php
|---->modules
------|--->default
------|--->admin
|---->library
I am using mod_rewrite to direct requests to my index.php in the document root. My file structure is as follows:
blog
|---->html
|--->images
|--->css
|--->js
|--->index.php
|---->modules
|--->default
|--->admin
|---->library
For example, I want the URL http://blog/admin to serve the admin module. This works fine, but when I type the URL http://blog/images/, mod_rewrite directs me to index.php (as in http:///blog/), but I want it to give me a listing of the images directory.
If I use a .htaccess file to do the rewriting, everything works fine (I get the images directory when I type http://blog/images/).
If I do the rewrite in the virtual host, I'm taken to http://blog/index.php.
Below is my Virtual host:
<VirtualHost *:80>
ServerName blog
ServerAdmin email@host.com.au
DocumentRoot /var/www/htdocs/blog/html
<Directory /var/www/htdocs/blog/html>
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -s [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -l [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
</VirtualHost>
I've been stuck on this for days, and am at the end of my tether!![]()
Sorry the hierarchical directory structure didn't display correctly:
blog
|---->html
------|--->images
------|--->css
------|--->js
------|--->index.php
|---->modules
------|--->default
------|--->admin
|---->library
Greetings.
You can simply add an .htaccess file into the images directory with RewriteEngine Off line.