option indexes and rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm new to httpd.conf (apache 2.0)
I want the server to respond in one of two ways to a request that looks like
a directory.
e.g. if the request is *http://localhost/a/b/c/*
then: (1) if a file with name "* c-en.html*" exists inside directory *c*,
then it should serve that,
(2) if that file does not exist, it should serve the directory listing of
directory *c*.
(note the space in front of  c-en.html, but I don't think it's relevant)

I wrote:

	RewriteEngine on
	RewriteCond /$1/$2/\ $2-en.html !-f
	RewriteRule ^(.*)/([a-z|A-Z|0-9|-|\ ]+)/?$ $1/$2/\ $2-en.html [L]

	Options Indexes

but either the rewrite rule works or the indexes work, but not the second if
the first fails.
I also do not understand:
(a) why I need to use !-f instead of just -f.
(b) why I need a / to start the RewriteCond.
Thanks for any help.



--
View this message in context: http://apache-http-server.18135.x6.nabble.com/option-indexes-and-rewrite-tp5005951.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux