0
votes
3answers
574 views

htaccess filesMatch exclusion

I have the following directive in my htaccess <filesMatch "\.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf|xml|html?)$"> FileETag None <ifModule mod_headers.c> Header unset ...
0
votes
0answers
56 views

htaccess Rewrite leading zero in url causing trouble

I have a database with a string column made up of four unique digits attached to each record. I know this isn't the best way to do this but I'm kind of stuck with it. I'm trying to rewrite urls from ...
-2
votes
1answer
25 views

Regex help for .htaccess

I want to exclude access to certain files using .htaccess files but i need help generating the correct regexp. I want to exclude access to these two files: soft1-pp_1.12-123456789010_amd64.deb ...
0
votes
2answers
306 views

How can I replace an apostrophe in a URL using htaccess?

I have a website with a search box on it. The search term is passed to the search page as part of the $_GET (I'm using PHP, but I think that's irrelevant to the problem I'm having), so my final url ...
1
vote
1answer
420 views

How to block all incoming proxy visits except from one specific I.P?

I have a page that is prone to attacks, so, in order to reduce the anonymous attacks, I use this code in my .htaccess which I found online : # BLOCK PROXY VISITS <IfModule mod_rewrite.c> ...
0
votes
1answer
336 views

Change default document root for all subdomains in directadmin

is there any way to set document root for all subdomains to a different path like: (www/path/subdomains) using regexps or something else? something like this? |*if SUB="*"| ...
0
votes
1answer
138 views

.htaccess rewrite: how to remove all directories but the first and second?

I'm trying to get a specific .htaccess rewrite done, but my regex skills are limiting me to do so; example 1: www.domain.com/dir1/dir2/dir3/file.txt should become www.domain.com/dir1/dir2/file.txt ...
0
votes
1answer
81 views

Htaccess regex working strange

I am trying to write .htacess file that would catch urls like: http://www.site.com/pageone.html http://www.site.com/pagetwo.html and redirect them to index.php so it would receive 'pageone' and ...
0
votes
1answer
54 views

htaccess not properly rewriting urls

This is a bit of a weird one. I'm doing some work on a server, and I need rewrite rules for directories that actually exist (in some cases, they are more than one level deep) At the moment my ...
1
vote
1answer
251 views

htaccess rewrite rules to match dynamic params

My base url looks like this. http://localhost/test/s/beer-drinks And depending on the users input it can be something like this. ...
2
votes
1answer
227 views

htaccess email regex

I am trying to write a patter in such a way that this link : http://www.mysite.com/link/go/emailadress@gmail.com is interpreted like this : ...
0
votes
1answer
212 views

Mod_rewrite excluding files/directories but including .php files

The traditional mod_rewrite for routing is as follows: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L] ...
0
votes
1answer
195 views

.htaccess ModRewrite when moving web root content into subdirectories?

I'm cleaning up and rearranging the files on my server (basic shared hosting situation) and am digging into .htaccess to do so. I'm moving the content I had in my web root into the subdirectory of ...
0
votes
1answer
1k views

Apache htaccess RewriteRule to remove trailing slash; infinite loop?

I use the following in .htaccess (mod_rewrite) to remove the trailing slash from my URLs: RewriteRule ^([a-z0-9_-]+)/$ $1 [L,NC,R=301] Of course, since the character class doesn't match a slash, ...
0
votes
1answer
47 views

Help with simple mod_rewrite needed

My site uses mod_rewrite for most URL's within the site. eg. domain.com/contact.htm domain.com/product/details.htm I've had domain.com/contact.htm working for a long time and is quite simple, but ...
1
vote
1answer
175 views

htaccess for wildcard subdomains

How to translate the example URL to the needed one? From http://test.at.domain.com To http://domain.com/at/index.php?at=test I have: RewriteEngine on RewriteCond %{HTTP_HOST} ...
1
vote
2answers
290 views

Why do two patterns (/.*) and (.*) match different strings?

Shouldn't the two patterns (/.*) and (.*) match the same string? My real question is actually: where did the "abc" go? Something funky seems to be happening inside the mod_rewrite engine... Given ...
1
vote
1answer
477 views

ForceType/SetHandler code - why does this work?

I tried this code, although it works for some reason, aren't there mistakes in it? I'm not sure what the best way to correct this is, but here it is... <Files .+*^$[]()> ForceType ...
0
votes
1answer
402 views

(\d+) and ([0-9]+) htaccess rewrite not working on new server, works fine on old server

RewriteRule ^mp3/(\d+)/(.*)/$ download.php?id=$1 [L,NC] is the specific rewrite rule I am trying to get working....it was working fine on my old server but now I am on a server with Apache 1.3.4.1 ...
1
vote
3answers
472 views

Request exceeded the limit of 10

My logs are FULL of [Tue Jan 11 10:20:45 2011] [error] [client 99.162.115.123] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' ...
0
votes
2answers
203 views

Generic .htaccess www.redirect

There are plenty of examples here of how to redirect example.com to www.example.com, but I'm looking for a generic version, so the same htacess code would also work to redirect example.net to ...
1
vote
2answers
520 views

.htaccess 301 redirect with regex

I am trying to fix a lot of errros in our old website regarding thing with product pages having multiple URLs associated with a single product. I am hoping that I can use regular expressions in with ...
1
vote
2answers
96 views

Deny access to the site, based on QUERY_STRING

My site is "under attack" : bots from many different IPs are filling a form with spammy content. IP addresses can't be filtered, they are always different, so I was thinking to filter by ...
1
vote
1answer
608 views

mod_rewrite rule for images with query string

I'm a mod_rewrite novice and a regex noob, but here's what I want to do: I've got a script that will re-size images on the fly. I'd like to be able to take any image file path, add a query string to ...
1
vote
1answer
39 views

Help with mod_rewite rule

I have a rule that will get the extension of every file from the url. I need to match all jpg, gif, png and bmp files. This is for a watermark application. Currently, it only matches jpg and Jpg. Can ...
0
votes
2answers
281 views

ModRewrite 9 Back Reference Limit

This is a complicated one which I hope has a simple answer... RewriteRule ^category/([^.]+)/([0-9]+)/([^.]+)/([0-9]+) category.php?c_id=$2&filters=$3&_p=$4&name=$1 This rule would pick ...