Questions tagged [rewritemap]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
541 views

Apache RewriteMap DB to match against list on RewriteCond

how to check url exist in some external file . Just checking given request URI is in the list of vanity urls. Vanity url's file present at /mnt/var/www/html/vanity_urls.txt RewriteMap vanityurls ...
0
votes
0answers
24 views

Apache 2.15, mod_rewrite and rewrite map - dealing with query strings and escaped characters

I've been given a series of URLs that require 301 redirects for SEO purposes, and I'm trying to figure out how to make use of Apache's rewrite function in order to deal with source URLs with query ...
1
vote
2answers
128 views

How do I handle a missing RewriteMap file?

I'm defining a RewriteMap in my Apache httpd configuration. (This is working correctly.) RewriteMap redirects-list txt:/path/to/redirects.txt But when the map file (/path/to/redirects.txt) doesn't ...
1
vote
1answer
304 views

RewriteMap not working, nothing is rewritten (Apache 2.4)

I have a bit of a unique situation: I need to take a subdomain and make it redirect to a random selection of alternate domains, each of which is on a separate server. Think load balancing, except it's ...
0
votes
0answers
29 views

Apache URL redirect using RewriteMap [duplicate]

I am struggling with the last part, writing proper RewriteRule (maybe I also need RewriteCond?). I have this mapping.txt: apple 30/products/apple.png xerox 38/products/xerox-300.png dell 3021/...
0
votes
1answer
1k views

postfix smtp_generic_maps with regular expression

I just started playing around with sender address rewriting with postfix. I run a server with debian-7.11 and postfix-2.9.6. Content of /etc/postfix/main.cf: [...] smtp_generic_maps = hash:/etc/...
0
votes
1answer
225 views

Unable to get RewriteMap to work

I'm trying to use RewriteMap in my virtualhost, but not getting any luck. Here is the content of my virtualhost file, with an entry (line) starting with RewriteMap. From what I read, the file /etc/...
0
votes
1answer
536 views

Using RewriteRule to match RewriteMap value and ignore any trailing slash and characters?

I'm trying to use RewriteMap in a apache 2.4 virtualhost .conf file to redirect a number of URLs. A variety of requests can refer to a single entry in the map and I'm having trouble matching these ...
3
votes
0answers
392 views

Apache RewriteMap TXT cache - updates don't take

Using a RewriteMap and have it set up with the txt file method - which works fine. Problem is, if I update that txt file - to either alter or add entries - the cache of that file created by httpd ...
0
votes
1answer
1k views

Apache Dynamic Virtual Host: RewriteMap: file for map vhost not found

Following the instructions on Apache's site I have added the following to the end of my httpd.conf file: RewriteEngine on RewriteMap lowercase int:tolower #define the map file RewriteMap vhost txt:/...
0
votes
1answer
80 views

mod_rewrite map doesn't work

I am trying to build a simple mod_rewrite map to have category names translated into ids like so: ../category/electronics -> category.php?cat=1 The map is placed inside the www folder. The code ...
1
vote
2answers
2k views

How to whitelist a directory in Apache configuration

In Wordpress, one of the few effective ways at reducing server load is to whitelist individual clients to /wp-login.php and /wp-admin/: <Directory /wp-admin> order deny,allow deny from ...
0
votes
1answer
1k views

RewriteMap syntax Regex

in my .htaccess i've tons of directives, with same syntax: RewriteRule ^(.*)/PRODUCT_1.aspx http://www.site.com/product.php?id_product=2891 RewriteRule ^(.*)/PRODUCT_2.aspx http://www.site.com/...
1
vote
2answers
2k views

Protecting images from direct access by checking current PHP session with mod_rewrite

I'm working on a solution to a problem where users could potentially access images (in this case PDF files) stored in a folder off the server root. Normally, my application validates users through PHP ...
0
votes
1answer
3k views

Apache RewriteRule with a RewriteMap variable substitution for the VAL argument to environment variable

I have an Apache server that serves up binary files to an application (not a browser). The application making the request wants the HTTP Content-MD5 header in HEX format. The default and only option ...
0
votes
3answers
768 views

htaccess internal error code 500

when I try to make 301 redirect I get an internal error code 500: Rewriterule ^categoy/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)? product_detail.php?category=$1&...
5
votes
1answer
6k views

Where is RewriteMap allowed?

This seems like a very simple question. I tried putting a RewriteMap directive in an .htaccess file but the logs showed an alert: RewriteMap not allowed here Then I tried putting it in the ...
0
votes
1answer
147 views

RewriteMap problem in .htaccess [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? I need to do one change in mywebsite. i have two websites. i want to redirect some of the ...
1
vote
2answers
2k views

RewriteMap problem in .htaccess

I need to redirect URLs of the form subpage.php?sid=123 to named pages. subpagemap.txt exists in the root and contains just the following delimited by Unix line endings \n: 1 a 2 b 3 c The ....