.htaccess

software development

#1

I’m experimenting with RewriteRule in .htaccess but I am getting errors when I try to use RewriteLog and RewriteMap. Have these directives been disabled?

The errors are similar: RewriteMap not allowed here

I’ve tried various directories with the same results. Any ideas?

Thanks!
-Don


#2

I am getting the same error. I would be really dissapointed if we can’t use a rewrite map. I cant find anything in their wiki, this forum, the unofficial blog, or pretty much anywhere talking about it.

Anyone know the official word, can we not write our own mod_rewrite RewriteMaps?

Trevor


#3

Hi Trevor,

Read the last line here:
http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html

Does this mean only Dreamhost can define a Map?

I have no experience with RewriteMap on other servers.

Thanks,
-Don


#4

since none of the .htaccess gurus around here have been able to answer your question, you might be best off to contact support and find out.

–Matttail
art.googlies.net - personal website


#5

Here’s your problem:

[quote]RewriteMap Directive
Description: Defines a mapping function for key-lookup
Syntax: RewriteMap MapName MapType:MapSource
Context: server config, virtual host
Status: Extension
Module: mod_rewrite
Compatibility: The choice of different dbm types is available in Apache 2.0.41 and later[/quote]
What that means, it’s usable only within the main server .conf file. Virtual host means you can use it within <Virtual…> which is only usable within the main server conf file.

You can’t use RerwiteMap within a .htaccess file. Context will have “.htaccess” listed as a usable file on directives usable in .htaccess.


yerba# rm -rf /etc
yerba#


#6

I haven’t used it myself, but from that doc page the RewriteMap program is started by the Apache server, so it isn’t something that can work in a shared hosting environment.


#7

I requested support on this and here is the reply:

"Unfortunately, we don’t support rewrite map. You can only change apache settings for your domain using .htaccess file, and for example rewrite rule works with that, but rewrite map requires modifications directly in the httpd.conf file, and you won’t be able to do that on our shared servers. "

Oh well…
-Don