-1
votes
1answer
20 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 ...
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
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
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 ...
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: ...
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 ...
1
vote
2answers
139 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
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 ^(/)?$ ...
1
vote
1answer
173 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 ...
1
vote
1answer
145 views

RewriteCond for multiple files

In htaccess file, RewriteCond for one file bla.php can write so right? RewriteCond %{REQUEST_FILENAME} !bla.php Question: how can write RewriteCond for multiple files? for example for 3 files: ...
3
votes
1answer
174 views

Trouble with www. redirect (.htaccess)

I'm trying to get a simple www. to non www. redirect set up. Here's the .htaccess DirectoryIndex index.php RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domain.org [NC] RewriteRule ^(.*)$ ...
0
votes
1answer
907 views

Multiple RewriteCond doesn't work

I have in htaccess some like this: RewriteCond %{HTTP_HOST} !^foo RewriteCond %{HTTP_HOST} !^bar RewriteCond %{HTTP_HOST} !^some RewriteRule ^register,(.*)$ /register.html [R=301,L] RewriteRule ...
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
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 ...
1
vote
2answers
83 views

Serve PHP page in web root but show contents in subdirectories

I have a web site on a shared hosting server. My directory layout looks like this /home /user /public_html /pics /family There is an index.php file in ...
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
134 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
1k 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 ...
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
3k 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
78 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
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. ...
1
vote
2answers
4k 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
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 ...
2
votes
1answer
121 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 ...
2
votes
1answer
6k 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] ...