Linked Questions

7
votes
5answers
86k views

How do I use .htaccess to always redirect from HTTP to HTTPS? [duplicate]

There's a few similar questions which I tried to work out the answer from, but so far I have been unsuccessful. Please advise how I can always redirect http to https (and also remove www. from the ...
17
votes
1answer
19k views

How to add exceptions to apache reverse proxy rules [duplicate]

I am trying to set a Apache reverse proxy so that requests get proxyed to another application running on 8080. However, I want some directories to be directly served rather than forwarded to proxy. ...
2
votes
6answers
18k views

Redirect from http to https [duplicate]

I have a Hudson/Jenkins installation which runs on port 443, so I can access it with https://ci.mydomain.com. I do not have a webserver running on port 80 like Apache Httpd, but I want if a user types ...
6
votes
3answers
20k 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] ...
2
votes
4answers
17k views

Apache webserver: How to redirect all requests to domain.com to www.domain.com [duplicate]

Something like this works for the index page: <VirtualHost *:80> ServerName example.com Redirect permanent / http://www.example.com </VirtualHost> <VirtualHost *:80> ServerName ...
3
votes
2answers
13k views

.htaccess - redirect non www to www and retain subdomains from redirecting [duplicate]

So, on my main domain 'domain.com' I created several subdomains from cPanel, like 'sub1.domain.com' and 'sub2.domain.com'. Their real location on server is in 'domain.com/sub1' and 'domain.com/sub2'. ...
2
votes
2answers
8k views

apache force if url has specific pattern redirect to https [duplicate]

How can I force Apache if URI start with "admin-" pattern or contain "admin/user/login" redirect to https of the same uri. For example: If the URI is : http://examplesite.com/admin-2dns24dw ...
1
vote
1answer
12k 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. ...
1
vote
1answer
3k views

How do you prevent mod_rewrite from decoding a string in the path? [duplicate]

I'm trying to create a restful API using mod_rewrite. I have the rule: RewriteRule v2/(.*)$ v1/index.php?request=$1 [QSA,NC,L] However the path could contain base64 encoded strings (i.e. can have ...
0
votes
1answer
9k views

Apache: too many redirects [duplicate]

My Scenario: i have running apache severing my UI and i have my node api running on port 2000 and i have a reserves proxy on apache to proxy request to api and i have configure ssl as well and i want ...
1
vote
2answers
5k views

How to set mod_rewrite in WAMP? [duplicate]

I learn Symfony2 and i have: http://symfony.com/doc/current/quick_tour/the_big_picture.html http://localhost/Symfony/web/app.php/demo/hello/Fabien And if you use Apache with mod_rewrite enabled, ...
1
vote
1answer
5k views

Rewrite a directory to another directory without a redirect [duplicate]

I have the following rewrite rule: RewriteRule ^support/(.*)$ /blog/support/$1 [R=301,NC,L] However, all it does is a simple redirect. What I want to is for /support to show the contents of /blog/...
1
vote
2answers
2k views

How can I use mod_rewrite to remove everything after the ? (question mark) in a URL? [duplicate]

How can I use mod_rewrite to remove everything after the ? (question mark) in a URL? For instance: http://127.0.0.1/ALL_FILES.php?test=1 after mod_rewrite: http://127.0.0.1/ALL_FILES.php For php ...
2
votes
1answer
6k views

How to get hostname into rewriterule [duplicate]

We've got a few subdomains setup, and I want to simplify some apache configuration - particularly as these particular subdomains are volatile. Anyway, I'm trying to get a rewrite rule that include the ...
0
votes
1answer
8k views

Redirect specific IP using htaccess [duplicate]

I am trying to figure out if it is possible to do a 301 redirect for a particular IP address (in this case brute force password bot). I want to send this guy to a project honeypot link rather than ...

15 30 50 per page