-1
votes
1answer
23 views

Block Wildcard User-agent

how can i write rewrite condition for wildcard user agents here is the code I'm trying but doesnt work RewriteCond %{HTTP_USER_AGENT} !*uTorrent* [NC] RewriteCond %{HTTP_USER_AGENT} ...
0
votes
0answers
26 views

After migrating to Plesk 11 / Apache 2.2.15, some rewrite rules ignored [duplicate]

First, thanks in advance for any insight. We recently migrated to Plesk 11 / Apache 2.2.15. After doing so a number of our rewrite rules no longer work as expected. For example, this no longer ...
0
votes
0answers
18 views

mod_rewrite Multilevel directories with pagination [duplicate]

I am trying to build rules for multilevel categories with pagination. Now, if there is no page input, it doesn't work. www.site.com/category/level1 www.site.com/category/level1/page=5 ...
1
vote
2answers
55 views

How to use mod_rewrite to abstract get request with subdomains

I've been at this all day and I thought I had a handle on regular expressions but I'm no longer confident that I do. I've searched all over, read through some horrible guides on mod_rewrite and I'm ...
0
votes
1answer
48 views

htaccess rewrite condition old site to new site with querystring

I am not even going to pretend to fully understand how htaccess rewrite conditions work. I've been working on this for a while searching and searching. I have an old Wordpress site www.old-site.com ...
-3
votes
2answers
61 views

Mod Rewrite code with out changing the url in address bar

I When I call http://www.mysite.in/abc/xyz it shoud show up http://www.mysite.in/abc/xyz/index.php but the url shout not change in address bar and it should work with out "/" in the address. Please ...
0
votes
0answers
47 views

How do you exlcude a sub-directory from an Apache rewrite ruleset?

I have a multilingual site with the root being English and a sub-directory (/es/) being a human translation into Spanish. Instead of manually updating all URLs, I have a opted to use mod_rewrite to ...
0
votes
1answer
147 views

SSL/TLS Client certificate Authentication using RewriteCond and Rewrite Rules to perceptively redirect traffic not authorized

I finally end up to write here because I´m badly struggling against apache, SSL/TLS and a client certificate authentication that should use the certificate´s Serial Number to restrict access to a ...
0
votes
1answer
718 views

RewriteCond not matching on my IP when matching on %{REMOTE_ADDR} [duplicate]

I want a mod_rewrite rule not to be executed when traffic is hitting the web-server from internal network. The web server is an apache 2.2 The following RewriteCond is meant to guard the rewrite rule. ...
0
votes
1answer
75 views

Apache rewrite rule infinite loop for subpage [duplicate]

I am trying to redirect toast.allthesmarts.com to toast.allthesmarts.com/dayone RewriteEngine on RewriteCond %{HTTP_HOST} toast.allthesmarts.com RewriteRule ^(.*)$ ...
0
votes
3answers
2k views

How do I make RewriteCond %{HTTP_COOKIE} match a cookie value exactly? [duplicate]

How do I make my rule match an exact value of a cookie? I've tried: RewriteCond %{HTTP_COOKIE} ^its=me$ [NC] RewriteCond %{HTTP_COOKIE} its=^me$ [NC] RewriteCond %{HTTP_COOKIE} its="me" [NC] ...
0
votes
1answer
111 views

RewriteRule (to remove .php) and old redirect 301 not working?

I'm not experienced in editing .htaccess I wanted to redirect non-www to www. remove .php extension set up a custom 404 page I managed to do this (looking for solution in the web and on ...
0
votes
1answer
88 views

Apache internal redirect limit reached

I have following problem: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel ...
1
vote
2answers
141 views

Redirect to a URL via htaccess if index.(html|php) doesn't exist

Is it possible to redirect (via a Rewrite Cond?) users to another URL for help if an index.html or index.php file doesn't exist within their home directory? Thanks Greg
0
votes
1answer
76 views

Redirecting all pages except for a select few back to HTTP

I'm using the rewrite rules below to redirect 2 php pages to https (to protect user data), but whenever I click on any links on those php pages they redirect with https enabled and the page does not ...
1
vote
1answer
175 views

Prevent redirect loop in mod_rewrite

I'm writing a rule in my htaccess that basically says this: If the request is for the homepage And a cookie has not been set Rewrite the page with /addCookie.php Then in addCookie.php, we set the ...
0
votes
2answers
266 views

Apache mod_rewrite redirect with prefix

I am newbie with Apache's mod_rewrite and I'm having some difficulties getting it to do what I want. In my static directory, I have some javascript files (.js) with 2 kind of filename: xxxx.js ...
0
votes
1answer
59 views

mod_rewrite to a folder except for a set of domains

Could anyone help to with the following issue: I'm trying to do a rewrite on all domains that won't match and push them to a given folder. The following vhost works locally (Mac OS X with XAMPP), but ...
0
votes
1answer
236 views

Apache Rewrite not rewriting as expected

I'm trying to use mod_rewrite to redirect users to the HTTPS equivalent URL unless the URL is for my Jenkins CI server. Here is the rule I have in my default site config (my Jenkins and other sites ...
0
votes
1answer
429 views

.htaccess: Backreference in RewriteCond to check for file existence?

I'm trying to match URLs of this type: http://www.example.com/image/12345 I'd then like to check whether this file exists: http://www.example.com/files/image_12345.jpg If it does, I'd like to ...
0
votes
1answer
67 views

mod_rewrite adds .html when redirecting

I have a redirect situation where the site is part dynamic and part generated .html files. For example, mysite.com/homepage and mysite.com/products/42 are actually static html files Whereas other ...
4
votes
1answer
989 views

How do I reset Apache's RewriteCond directive?

I have some Apache configuration like this: # Image hotlinking rule RewriteCond %{HTTP_REFERER} ^http://badsite\.com/ RewriteRule .*/static/artwork/.*\.(jpg|png)$ /static/images/hotlink.png [L] # ...
2
votes
1answer
150 views

apache httpd keep sending http requests to strange IPs

Recently I noticed my server keeps sending data to strange location "121.11.76.48" by netstat -na . To find out what it is sending , I tried : tcpdump -i eth0 host 121.11.76.48 -nnvvXSs 1514 And ...
0
votes
1answer
89 views

Redirect URL including folder path

I have the following rewrite rule setup: rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://domain2.com/$1 [r=301,nc] Now this works for redirecting domain.com/index.htm to ...
0
votes
2answers
122 views

.HTACCESS RewriteRule for 2 Domains

I have two domains, which content is in the same file directory: http://www.alpha.com/ DIR: /var/www/alpha.com/ and http://www.beta.com/ DIR: /var/www/beta.com/ I want to do the following ...
0
votes
1answer
56 views

Multiple Rewrite conditions and rules for custom paths

At the moment I have… RewriteCond $1 !^(index\.php|img|css|js|fonts|jw|mail|uploads|user_guide) RewriteRule ^(.*)$ /index.php/$1 [L] However, I want to be able to rewrite a url like /page/about/ ...
0
votes
2answers
150 views

Help with Apache rewriteengine rules

I am trying to write a simple rewrite rule using the rewriteengine in apache. I want to redirect all traffic destined to a website unless the traffic originates from a specific IP address and the URI ...
0
votes
1answer
214 views

RewriteRule applying pattern even though 1 of the RewriteCond's failed

#www. domain . tld RewriteCond %{HTTP_HOST} (?:.*\.)?([^.]+)\.(?:[^.]+)$ RewriteCond /home/%1/ ...
1
vote
1answer
68 views

mod_rewrite for specific domains in a mappings file

I have a bunch of domains that I want to go to one domain but various parts of that domain. # this is what I currently have RewriteEngine On RewriteCond %{HTTP_HOST} ^.*\.?foo\.com$ [NC] RewriteRule ...
0
votes
1answer
192 views

Compact Redirects in Apache/htaccess. How? [An Elegant Coding Question]

when setting my redirects in htaccess, i have trouble setting/combining various domains when they all go to the same homepage. I can do them separate, but that isn't neat/elegant. How to rewrite the ...
1
vote
2answers
82 views

Lazy Conditional Rule not doing anything! Why?

I am rewriting php generated thumbnails with igly urls into nice ones. instead of img.php?src=bla.jpg&w=200&h=100 the static filenames IMG-file_w200_h100.jpg Because the rewrite is so ...
1
vote
2answers
519 views

htaccess .html rewrite exception

Ok guys I need to add an exception! How can I do this? I currently use RewriteRule ([^.]+).html $1 [R=301,L] to rewrite all .html urls I do need the exception for the google.html verification file. ...
0
votes
2answers
538 views

Why does this mod_rewrite rule 'not-match'? (big rewrite log included)

I've got a scenario involving two domains: WordPress site hosted on domain1.com domain2.co.uk, simply redirecting users to domain1 via mod_rewrite This rule applies irrespective of whether www. is ...
2
votes
1answer
122 views

unique .htaccess question about mod_rewrite and RewriteCond

I have a few rewrite rules like these RewriteRule ^dir/(.*)-something.html otherdir/file1.php?var1=val&var2=$1 [L,NC] RewriteRule ^dir/ otherdir/file2.php?var1=val [L,NC] dir/ is not a real ...
0
votes
1answer
383 views

How to make RewriteCond+RewriteRule change domain2/folder1 to domain1/folder1

There's actually 2 questions. One is, how do I make RewriteCond+RewriteRule change domain2/folder1 to domain1/folder1 Actually what I want is any domain that tries to access folder1 that is not ...