Questions tagged [redirection]
The redirection tag has no usage guidance.
328
questions
285
votes
5
answers
115k
views
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 ...
46
votes
8
answers
30k
views
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 ...
46
votes
2
answers
113k
views
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/...
40
votes
1
answer
4k
views
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 ...
22
votes
5
answers
29k
views
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 ...
13
votes
2
answers
59k
views
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 ...
12
votes
3
answers
7k
views
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 ...
12
votes
2
answers
14k
views
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 <someone>@tedswigets.com to ...
9
votes
4
answers
49k
views
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 ...
9
votes
3
answers
5k
views
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 ...
8
votes
3
answers
71k
views
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 ...
8
votes
2
answers
8k
views
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). ...
5
votes
1
answer
4k
views
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/...
5
votes
1
answer
9k
views
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 ...
5
votes
0
answers
2k
views
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 ...
4
votes
2
answers
9k
views
socat connect-connect "proxy" two inbound TCP connections to expose a firewalled service?
I'm struggling a bit trying to see how to use socat (or a similar TCP port redirector) to expose a firewalled service on a PC.
Here's the scenario: I have a server PC which will be acting as a ...
4
votes
2
answers
17k
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'.
...
4
votes
1
answer
6k
views
Redirect DNS requests for 8.8.8.8 to a local DNS inside a LAN
I have a local network (10.0.0.0/24) with a gateway (I'll call it G, IP 10.0.0.1), a device (I'll call it N, IP 10.0.0.31) making DNS requests directly to 8.8.8.8 completely ignoring DHCP setting for ...
4
votes
4
answers
8k
views
How can I redirect domain A to domain B without hosting, using only DNS records?
I want to redirect domain A (without hosting space) to domain B (301), but when I try https://domainA.com or https://www.domainA.com it ends with ERR_CONNECTION_REFUSED. Is it even possible to use ...
4
votes
1
answer
8k
views
Difference between Roaming profiles, User Profile, Home Folder, and Redirected Folders?
On the network where I work, it appears at various times people have had roaming profiles, user profiles, redirected folders, and home folders.
What are the purposes and differences between these?
...
4
votes
1
answer
3k
views
Failover/redundant SSH
I have an SSH server where multiple clients SSH in to maintain a bunch of port forwards.
What I want to do is, if the server goes down, have the clients automatically connect to the next server.
The ...
4
votes
4
answers
3k
views
Providing DNS redirection to honeypot server for known bad domains
Currently running BIND on RHEL 5.4 and am looking for a more efficient manner of providing DNS redirection to a honeypot server for a large (30,000+) list of forbidden domains.
Our current solution ...
4
votes
3
answers
1k
views
How can one redirect to a new host all traffic destined for an old host?
We're moving a bunch of services, say from 1.2.3.4 to 5.6.7.8.
In order to test that the new services are correctly configured, we'd like to redirect (to the new host) all traffic destined for the ...
3
votes
3
answers
1k
views
SH conditional redirection [closed]
I want to be able to redirect some output of my script to /dev/null based on a command line switch.
I don't know how should I do it.
In a silly way, it would be something like this (in a too ...
3
votes
1
answer
10k
views
Using iptables port redirection with docker
I have a Linux server running Jenkins (HTTP on port 8080) and the same server is also running Docker 1.12.1. I used some iptables rules (as per official Jenkins install docs) to redirect port 8080 to ...
3
votes
2
answers
2k
views
Fix missing ssl-cert for subdomain www. using redirect or similar
We're using setup with an nginx on one machine and (currently) one application server on apache in the back.
For multiple domains we got ssl certs, but only for the domain itself. So without ...
3
votes
1
answer
7k
views
Using Apache RedirectPermanent to send all requests to a specific subfolder
Having asked a long and convoluted question earlier, I now have some code here using RedirectPermanent that I need help with.
We're merging an old site into the new one, and don't care about mapping ...
3
votes
1
answer
2k
views
Folder Redirection on Domain Controller Win Server 2008
This is a long post with a few questions in it. They are all related to the same issue though, and solving one or the other will probably solve the others. I did look on superuser for similar ...
3
votes
2
answers
3k
views
Why I cannot access iDRAC9 remotely?
I have a Dell PowerEdge T350 with an iDRAC9 Basic. The server is connected to a switch which is connected to a router upstream which is connected to the internet. Very simple. Both the server's NIC1 ...
3
votes
1
answer
6k
views
Nginx: Redirect URL to always include a locale prefix
I'm trying to achieve something with nginx and redirect rules which seems like it should be pretty straightforward, but I've run into a stumbling block.
Having had a look through many questions and ...
3
votes
1
answer
2k
views
Forcing command on ssh's authorized_keys merges STDOUT and STDERR
I've been working to have a script in a centralized server to do some things and output a .tar.gz file (see redirect temporarily STDOUT to another file descriptor, but still to screen). I also have ...
3
votes
1
answer
269
views
How do I remove the www from my domain URL
I am using a tomcat server and I have installed the SSL by changing strings in
server.xml and web.xml file.
Problem is, When I browse with domain.com, www.domain.com, in both the cases it is browsing....
3
votes
1
answer
2k
views
Redirect traffic from one IP address
A have a root server with 2 static IP address which are both connected to one interface (eth0 and eth0:1). Now I need to redirect all incoming traffic from one IP address to a VM on the same PC. The ...
3
votes
2
answers
4k
views
htaccess redirect/rewrite rules for language specific domain
I have Grav CMS based multilanguage site and two domains:
grav-site.pl and grav-site.com
I want to redirect :
grav-site.pl/en -> grav-site.com
grav-site.com/pl -> grav-site.pl
In grav knolage base ...
3
votes
3
answers
2k
views
Redirect subfolder to another local IP in apache [closed]
I've got a raspberry pi working and being accessible through a domain, which is asada.net. It serves web pages using apache 2.2.22.
Besides, I recently bought a NAS which has a web page in a local ...
3
votes
1
answer
3k
views
URL redirection and TCP proxy in haproxy
In a server with only one ipv4 and running haproxy, i want to redirect an url and proxy another in TCP level, for ssl passthrough purpose.
frontend https-frontend
bind *:443
mode tcp
option ...
3
votes
1
answer
4k
views
Windows redirect outgoing traffic
I need to redirect the network traffic in a Windows server which is destined from the 111.111.111.111:100 address to the 222.222.222.222:100
address, for example.
This would be easy with iptables but ...
2
votes
3
answers
3k
views
redirect temporarily STDOUT to another file descriptor, but still to screen
I'm making a script that executes some commands inside, and these commands show some output on STDOUT (and STDERR as well, but that's no problem). I need that my script generates a .tar.gz file to ...
2
votes
2
answers
2k
views
How do I redirect a specific URL/ROUTE/PATH/LOCATION to another?
Say my client (current device) wants to connect to a URL, say foo.bar.com/spam/eggs/123, how do I serve or redirect to another specified URL, say 127.0.0.1:8080, and prevent the client from reaching ...
2
votes
3
answers
1k
views
Redirect subdomain to subdomain Apache2
Let's say I have a web server with IP address: 1.2.3.4.
I also have 2 subdomains:
sth.city.eu
inf.xyz.city.eu
I'm using apache 2 on Ubuntu Server. Here's my /etc/apache2/sites-enabled/site ...
2
votes
1
answer
1k
views
Weird http -> https redirection although not configured
I am running Apache 2.2.15 (CentOS 6.6) with a HTTP-only domain
demo.xml-director.info
Using wget I can retrieve the content properly
wget -S http://demo.xml-director.info
--2015-01-05 13:31:41-- ...
2
votes
3
answers
3k
views
Run FTP session from bash script
I'm trying to write a BASH script to test if an FTP site that I own is running. I therefore want the bash script to connect to the FTP site, log in with a dummy account and redirect the output to a ...
2
votes
1
answer
7k
views
Issue when redirecting a folder using IIS url rewrite
Using Url Rewrite, I'm trying to redirect /foo_bar/* to /foo/*. I've tried this:
<rule name="Redirect foo_bar to foo" stopProcessing="true">
<match url="(.*)" />
<conditions ...
2
votes
1
answer
3k
views
Nginx - Redirect any Subdomain to File without Rewriting
Recently I have switched from Apache to Nginx to increase performance on a web server running Ubuntu 11.10. I have been having issues trying to figure out how certain things work in Nginx compared to ...
2
votes
1
answer
701
views
Redirect subdomain.xyz.com to subdomain.abc.com
Hey all, I'm trying to move to another domain, but have many subdomains under the existing domain. All the subdomains will be the same but just mapped with the new domain.
[subdomain].xyz.com => [...
2
votes
2
answers
2k
views
How do I redirect multiple domains to a single domain in lighttpd
If I have the following domains in lighttpd:
domain1.com
domain1.co.uk
domain2.com
domain2.co.uk
How do i redirect all these to to 'domain.com'?
ie:
domain1.co.uk/some-path/ redirects to domain....
2
votes
1
answer
135
views
Redirect to language specific domain - Apache 2.4
I'm using Apache 2.4 to host those domains:
domena.pl/
domena.pl/ru
domena.pl/en
I need to redirect domena.com to domena.pl/en. Here's my htacces file:
RewriteCond %{HTTP_HOST} ^(www\.)?domena\.ru
...
2
votes
1
answer
4k
views
Nginx: Redirect all traffic to Coming Soon page except own IP
I have a folder called "coming-soon" that I would like to redirect all traffic to when the site is down for maintenance.
Currently, this is what I did:
----- START -----
location / {
allow 123.456....
2
votes
1
answer
354
views
Can I redirect an HTML link on our webpage to another server?
We have a website that we host. In the sites header, we have links to sections of our site. eg.
[Logo] [Buy] [Sell] [Pew Pew]
and the current links are
Logo: / (root of the site)
Buy: /buy/
Sell: /...
2
votes
2
answers
4k
views
Non-blocking bash redirection
Does anyone know how to redirect the output of a program, running from a bash script, to a named pipe IN NON BLOCKING MODE (having 'O_NONBLOCK' flag set)?