Sponsored Content
Top Forums Web Development How to redirect URLs in Apache? Post 302883112 by GosarJunk on Friday 10th of January 2014 09:37:52 PM
Old 01-10-2014
Question How to redirect URLs in Apache?

I am a total newbie to Apache. I need to do this only for this weekend during an upgrade from old system to new system

We have different URLs http://domain.name/xxx (xxx varies to any length and words - it can be /home, /login, /home/daily, /daily/report, etc).

How do i redirect all those to one site.

For example
http://domain.name --> needs to redirect to https://new.domain.name
http://domain.name/login --> needs to redirect to https://new.domain.name
http://domain.name/home/daily/ --> needs to redirect to https://new.domain.name
http://domain.name/daily/report/ --> needs to redirect to https://new.domain.name
and so on

Using DNS entry for IP re-direct the first one works fine http://domain.name --> https:/new.domain.name

But for all others - I tried updating the httpd.conf with
RedirectMatch permanent /.* https://new.domain.name/
or
RedirectMatch permanent /.*$ https://new.domain.name/
or
RedirectMatch permanent /(.*)$ https://new.domain.name/

But all the above solution one going into infinite loop but short of using each and every possible URL to redirect to the same URL - how can i use the regular expression to point it to one URL (https://new.domain.name/) for entire old site of http://domain.name/*

I read online to use mode_rewite and mod_alias and .htaccess..buit not comfortable using that (unless there is no other solution). Looking for a quick solution for this weekend only. Is it possible to do this using Redirect or RedirectMatch ??
 

9 More Discussions You Might Find Interesting

1. HP-UX

Apache Redirect Transparently

I have two servers running apache server, namely server A and B. All users access server A, but for some application, I would like to redirect the request to server B. I have set apache redirect in server A apache config file. Redirect /application http://serverB/application Now, the flow... (2 Replies)
Discussion started by: alfredo
2 Replies

2. Cybersecurity

APACHE rewrite / redirect URL

Hello. I have scenario where a Client send request to Server1. Server1 send request to Server2. Request are xmlHTTPRequest - need to get data (XML) from Server2 back to client. Trying to use APACHE proxy... Anyone can help? What to download / configure / ...? Thank you for your help. (1 Reply)
Discussion started by: ampo
1 Replies

3. Web Development

APACHE rewrite / redirect URL

Hello. I have scenario where a Client send request to Server1. Server1 send request to Server2. Request are xmlHTTPRequest - need to get data (XML) from Server2 back to client. Trying to use APACHE proxy... Anyone can help? What to download / configure / ...? Thank you for your... (2 Replies)
Discussion started by: ampo
2 Replies

4. Web Development

why do apache redirect me to the same path ?

Hi, everything is working perfectly. I have one more question. Is it possible to specify a file instead of a directory in DocumentRoot ? (see phpinfo.php in the example). Is it a correct procedure ? <VirtualHost www.patrick.dev:80> ServerAdmin patrick.diviacco@gmail.com ... (1 Reply)
Discussion started by: aneuryzma
1 Replies

5. Web Development

Redirect to diff port on apache

Hi, I'm running both mail (webmail port = 8080) and web (http = 80) on same box. i am able to redirect as below without any problem. From: http://mail.abc.com To: http://www.abc.com:8080 I did the above with a simple virtualhost and redirect directive. But my requirement is to have same... (1 Reply)
Discussion started by: reddyr
1 Replies

6. Web Development

redirect http to https in apache

i read thru a few article how to do it, but i could not get it to work the way i want it. vi ../httpd.conf Redirect permanent /dev https://servername/portal/ when i type servername, works fine. my goal is to type dev, and it takes me to https://servername/portal/ (4 Replies)
Discussion started by: lawsongeek
4 Replies

7. Shell Programming and Scripting

Apache redirect file exceptions

Hi, I am currently redirecting all mobile devices to my mobile site in apache. I need to exempt the following file types from redirecting even if the request is made from a mobile device. *.css *.jpg *.jpeg *.gif *.js Does anyone know where and what I need to do for this? Thanks in... (1 Reply)
Discussion started by: kmaq7621
1 Replies

8. Web Development

Apache Redirect

Hi All, I have my URL as http://mysite.com/shop/maternity/tops_30116 Now I want to append "?No=0&Nrpp=100" and then redirect to http://mysite.com/shop/maternity/tops_30116?No=0&Nrpp=100 This is for many URL which have "maternity" inside them. Can there be a single Redirect... (0 Replies)
Discussion started by: ankur328
0 Replies

9. Web Development

Need help on Apache configuration for redirecting URLS

I am extremely new to Apache httpd configuration. Can you please help here below is my requirement. If the URL match existing resource - return resource. If the URL doesn't match existing resource it should return index.html from the app root directory. Apps root directories are: 1.... (0 Replies)
Discussion started by: kar_333
0 Replies
URI::URL(3)						User Contributed Perl Documentation					       URI::URL(3)

NAME
URI::URL - Uniform Resource Locators SYNOPSIS
$u1 = URI::URL->new($str, $base); $u2 = $u1->abs; DESCRIPTION
This module is provided for backwards compatibility with modules that depend on the interface provided by the "URI::URL" class that used to be distributed with the libwww-perl library. The following differences exist compared to the "URI" class interface: o The URI::URL module exports the url() function as an alternate constructor interface. o The constructor takes an optional $base argument. The "URI::URL" class is a subclass of "URI::WithBase". o The URI::URL->newlocal class method is the same as URI::file->new_abs. o URI::URL::strict(1) o $url->print_on method o $url->crack method o $url->full_path: same as ($uri->abs_path || "/") o $url->netloc: same as $uri->authority o $url->epath, $url->equery: same as $uri->path, $uri->query o $url->path and $url->query pass unescaped strings. o $url->path_components: same as $uri->path_segments (if you don't consider path segment parameters) o $url->params and $url->eparams methods o $url->base method. See URI::WithBase. o $url->abs and $url->rel have an optional $base argument. See URI::WithBase. o $url->frag: same as $uri->fragment o $url->keywords: same as $uri->query_keywords o $url->localpath and friends map to $uri->file. o $url->address and $url->encoded822addr: same as $uri->to for mailto URI o $url->groupart method for news URI o $url->article: same as $uri->message SEE ALSO
URI, URI::WithBase COPYRIGHT
Copyright 1998-2000 Gisle Aas. perl v5.16.3 2012-02-11 URI::URL(3)
All times are GMT -4. The time now is 10:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy