The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
3answers
48 views

How to remove hypen (-) using nginx rewrite rule?

I am using this rewrite rule to redirect example.com/a-b-c?id=learn-more ----> http://example.com/abc?id=learnmore rewrite ^/a-b-c?id=learn-More http://example.com/abc?id=learnMore permanent But ...
0
votes
3answers
329 views

www vs. non-www and subdirs with special .htaccess

In my root folder, the following captures https://example.org and http://example.org and redirects to its respective version (http or https) with the www added back in. (It's a requirement they had ...
0
votes
2answers
159 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
2answers
567 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 ...
0
votes
2answers
217 views

RewriteRule dropping escaped parameter

I need some help with the following RewriteRule: RewriteRule ^/iesearch/(.*)$ /jsp/search/ieaccelerators/visualsearch.jsp?q=$1 [L,PT] The intention is to rewrite search-queries from ...
2
votes
1answer
2k views

How to exclude a sub-folder from HTaccess RewriteRule

I have WordPress installed in my root directory, for which a RewriteRule is in place. I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such. Problem is that ...
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
70 views

VirtualHost Redirect should work with new RewriteBase

Inside the VirtualHost I got this redirect: RewriteBase / RewriteCond %{REQUEST_URI} wp-content/uploads/([^.]+\.(jpe?g|gif|bmp|png))$ RewriteRule (.*) http://example.org/$1 [R=301,L,NC] So the full ...
0
votes
1answer
112 views

existing file gives 404 due to a RewriteCond rule in .htaccess

To redirect a specific domain name to a folder in my public dir, www/, I edited .htaccess to the following: RewriteEngine On RewriteCond %{HTTP_HOST} ^(.+)?domain.com$ RewriteRule ^(/)?$ ...
0
votes
1answer
63 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
530 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
74 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 ...
0
votes
1answer
675 views

Apache mod_rewrite to return a 404 except one directory

I'm trying to configure Apache to return a default 404 page when the / of DocumentRoot is called, except for some directories in that DocumentRoot Unfortunately, I'm getting a 404 even for the ...
0
votes
1answer
59 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
1answer
396 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 ...
1
vote
0answers
187 views

How to rewrite using htaccess if the file exists in another folder?

We are trying to rewrite to another folder if the file does not exist in the document root, but does exist in the other folder. The other folder is in a completely different location, which is ...
0
votes
0answers
21 views

apache restrict foreign domain and redirect subdomains

I want my server to block requests which are not addressed to my domain including subdomains. The same way I want that not existing subdomains (*.domain.de) are redirected to "www.domain.de". ...
0
votes
0answers
86 views

Avoid directory traversal attack with RewriteCond

this may seem a pretty stupid question, but I want to make sure I'm not doing anything wrong. I have an Apache web server (2.2.26) that acts as a front-end for my application. It servers the static ...
0
votes
0answers
67 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 ...