Questions tagged [redirection]

328 questions
284
votes
5 answers

Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask

This is a Canonical Question about Apache's mod_rewrite. Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as: Changing HTTP to HTTPS (or the…
Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
46
votes
8 answers

create 'virtual file' from bash command output?

I wonder if there is a way to create a 'virtual file' from a bash output. Example: Let's say I want to email the output of mysqldump as an attachment to an external email address. I can use Mutt to do so. The mutt option I need to use is -a
ppbitb
  • 562
  • 1
  • 4
  • 7
45
votes
2 answers

How to quick and easy remove part of an URL in Nginx with HttpRewriteModule?

I know about the HttpRewriteModule, but I don't really know how to handle regex and I would need to redirect all URLs within a certain directory to another, specifically: From: example.com/component/tag/whatever To: example.com/tag/whatever Could…
javipas
  • 1,332
  • 3
  • 23
  • 38
40
votes
1 answer

Why can I update a file owned by root using sudo vi, but not append a line to it with sudo echo "Thing" >> file?

I would like to have script that is doing automated migrations of websites from another be able to append Includes to the /etc/httpd/conf.d/vhosts.conf file. However, when I try to use echo to put append a string to the end of the file I get this: $…
Nick Weavers
  • 501
  • 4
  • 8
22
votes
5 answers

Prevent port change on redirect in nginx

I currently have nginx setup to serve content through Varnish. Nginx listens on port 8000 and varnish connects users' requests from 80 to 8000. The problem is, on some occasions, particularly when trying to hit a directory, like site.com/2010, nginx…
arbales
  • 527
  • 1
  • 4
  • 16
13
votes
2 answers

Apache2 multiple hostnames redirected to one

I'm trying to redirect multiple hostnames to only one, for example, if you enter any of: foo.example.com www.example.com bar.example.com eample.com you must be redirected to www.example.com I have installed a virtual host with www.example.com as…
alcuadrado
  • 233
  • 1
  • 3
  • 6
12
votes
2 answers

How to redirect all mail from one domain to another in Postfix?

I have two forms of the same domain name, one being a common misspelling of the other, let's say tedswidgets.com and tedswigets.com. I'd like to redirect all mail for @tedswigets.com to that same @tedswidgets.com. There's plenty of…
thomasrutter
  • 2,527
  • 1
  • 25
  • 34
12
votes
3 answers

How can I redirect an entire site to a single page?

I'm in the process of shutting down a site, and have replaced the old site with a single "nobody home" page at the root level of the site. Now I need to set up some redirection, so that any request to any part of the site, no matter how complicated,…
Jim Miller
  • 713
  • 2
  • 11
  • 23
9
votes
3 answers

How do I obscure my Wordpress install via htaccess?

(I am aware that security via obscurity is not recommended). I am trying to hide the fact that I am using Wordpress. This post is helpful, but it only addresses the content (sort of). I am interested in having the following occur: User tries to…
Son of the Wai-Pan
  • 757
  • 4
  • 11
  • 25
9
votes
4 answers

Redirect subdomain.example.org to somethingelse.com hidden to the user?

I'm not knowledgeable at all about C-NAMES, A-RECORDS, name servers and the like, so just bear with me on this one: I want to redirect subdomain.example.org to another domain somethingelse.com. I do own both domains and both domains run on shared…
Dennis G
  • 598
  • 3
  • 8
  • 20
8
votes
2 answers

Access D-Bus remotely using socat

Description: I'd like to access a D-Bus system service from another machine, knowing only machine's IP address and the service to connect to. What I have recently found is Gabriel (D-Bus over SSH). I have compiled its GIT version (hosted on…
schedar
  • 261
  • 2
  • 7
8
votes
3 answers

Find users that are auto forwarding / redirecting their email in Exchange 2010 using Powershell

We are using Live@edu, which is essentially hosted exchange server with some additional features and limitations to work around, and I'm trying to find everybody that is forwarding or redirecting emails from their accounts. I am trying to remove old…
Ryan H
  • 1,468
  • 3
  • 15
  • 19
5
votes
1 answer

haproxy redirect custom http traffic to a custom https port

I wish to redirect my custom http port traffic to custom https port based on the port I receive traffic on I have multiple bind statements : bind 1.2.3.4:7777 bind 1.2.3.4:8888 bind 1.2.3.4:9999 ssl crt /etc/haporxy/somecert.crt What I've tried…
UtkarshK
  • 63
  • 1
  • 5
5
votes
1 answer

lxc-attach command with redirection

I'm setting up for a Proxmox 4 server a script that migrates OpenVZ dumps from a Proxmox 3.4. The scripts scp the backups, restores them and so on. At a time of the process, I'd like to wipe /etc/network/interfaces and setup a new one using "pct…
X99
  • 192
  • 4
  • 14
5
votes
0 answers

NGINX auth_request and 302 response status = 500 invalid URL prefix

I'm trying to make NGINX authenticate requests with OAuth2 server (authorization code flow) that will redirect client to the login page. Is it possible to use auth_request directive for that? Here is my nginx.conf: server { listen…
1
2 3
21 22