Replace auto indexing? <or> Fix mod_rewrite

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Replace auto indexing? <or> Fix mod_rewrite

Post by Skara »

Is it possible to auto index folders with your own file?

Edit: If that isn't possible, could someone tell me what's wrong with this?

Code: Select all

<Directory "/fileserver">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    <IfModule mod_rewrite>
      RewriteEngine On
      RewriteRule ^/fileserver/([^\.]+) /files/$1 [L]
    </IfModule>
</Directory>
where..
DocumentRoot "/fileserver"
..and..
/fileserver
/fileserver/files
/fileserver/files/example

I want
http://localhost/example
to read from
http://localhost/files/example

But--- Only directories, no files.

Basically I want to make it appear as if the files directory doesn't exist... if that makes sense.
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

Ok, I had some more time to test it. wtf.

I cannot get mod_rewrite to work. I don't know why, but it doesn't. at all.

LoadModule rewrite_module modules/mod_rewrite.so #<< /is/ loaded...

Code: Select all

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Satisfy all
    RewriteEngine On
    RewriteRule ^/test /test2 [R,L]
</Directory>
or

Code: Select all

<Directory "/fileserver">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    RewriteEngine On
    RewriteRule ^/test /test2 [R,L]
</Directory>
nothing happens.

And yes, I'm restarting apache each time I change httpd.conf. And yes, it's the correct file.

this is retarded. ideas?
Post Reply