The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
3answers
296 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
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
2answers
537 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
213 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 ...
-3
votes
2answers
60 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 ...
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
90 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
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
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 ...
0
votes
1answer
450 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
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
1answer
382 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
36 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
32 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
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
0answers
45 views

Redirect to HTTPS and back with .htaccess on specific pages

I'm trying to use rewrite rules to redirect to HTTPS on specific pages, and back to HTTP on all the other pages. The pages that needs to be redirect are those who have the following in the URL: ...