The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
60 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
350 views

Matching more than one Query String with RewriteCond

I have the following configuration in an Apache configuration file for a CGI script: RewriteEngine on RewriteCond %{QUERY_STRING} !^/var/log/syslog-ng/JBoss.*$ RewriteRule ^/cgi-bin/(.*)$ ...
0
votes
1answer
161 views

Redirect homepage but not if there are query strings present

I want to redirect just the homepage of a Wordpress site but only if the original URL does not have any query strings on it. This works: RedirectMatch 307 ^/$ ...
1
vote
2answers
2k views

htaccess with conditional rewritebase

I have a site (the-tack-shop.co.uk) in which I'm testing my e-commerce framework on. I was trying to test payment using a shared SSL: https://web43.secure-secure.co.uk/the-tack-shop.co.uk/. I had to ...
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
1answer
243 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
217 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
4k views

RewriteCond in .htaccess file gives me bad flag delimiters

I'm upgrading a website and I use this .htaccess file to show maintenance page: #MAINTENANCE-PAGE REDIRECT RewriteEngine on RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.0 # Bogus IP address for posting ...
0
votes
2answers
81 views

safe 301 redirection using htaccess for two domains

I have two domains, a new domain (newdomain.com) and and old legacy domain (olddomain.com). I want to safely redirect the old domain to the new domain. Easy enough. At the moment I am doing this ...
1
vote
2answers
575 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. ...
2
votes
2answers
5k views

One RewriteCond for multiple RewriteRules

I need to preserve all user query strings. RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^$ index.html?page=home&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^about$ ...
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 ...
0
votes
2answers
572 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
123 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
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 ...
2
votes
1answer
7k views

How to exclude one subfolder from my RewriteRule Htaccess rules?

I have a .htaccess in my root of website that looks like this: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mydomain\.pl [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?([a-z0-9_-]+)\.mydomain\.pl [NC] ...