Quantcast

[OT] Apache redirect match

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[OT] Apache redirect match

French, Shelane
So I need to put redirects in from one server to another and from a wiki to confluence. The links are essentially the same, but there are a couple of differences.

I need a link like:
https://oldserver.com/index/Quick_Lists

to redirect to this:
https://newserver.com/display/SCS/Quick+Lists

The underscore gets converted to a + and the path is replaced.

Anyone particularly good at these?


Shelane French
Workforce Enablement
Livermore Information Technology


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [OT] Apache redirect match

Marc Vos-3
I don't know how to redirect URLs directly, but to me it seems you have to first add a redirect from oldserver.com to newserver.com :

<VirtualHost *:80>
ServerName https://oldserver.com/
RedirectPermanent / https://newserver.com/
</VirtualHost>

and then on newserver.com convert the old path to the new path. But how to that, you have to ask someone else.

- -
Regards,
Marc


> On 1 feb. 2017, at 23:59, French, Shelane <[hidden email]> wrote:
>
> So I need to put redirects in from one server to another and from a wiki to confluence. The links are essentially the same, but there are a couple of differences.
>
> I need a link like:
> https://oldserver.com/index/Quick_Lists
>
> to redirect to this:
> https://newserver.com/display/SCS/Quick+Lists
>
> The underscore gets converted to a + and the path is replaced.
>
> Anyone particularly good at these?
>
>
> Shelane French
> Workforce Enablement
> Livermore Information Technology
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [OT] Apache redirect match

French, Shelane
It can and should all be handled on the oldserver. I’m just not sure on modifying that end page path. I will have no access to the do redirects on the newserver.




Shelane French
Workforce Enablement
Livermore Information Technology

On 2/1/17, 3:15 PM, "[hidden email] on behalf of Marc Vos" <[hidden email] on behalf of [hidden email]> wrote:

    I don't know how to redirect URLs directly, but to me it seems you have to first add a redirect from oldserver.com to newserver.com :
   
    <VirtualHost *:80>
    ServerName https://oldserver.com/
    RedirectPermanent / https://newserver.com/
    </VirtualHost>
   
    and then on newserver.com convert the old path to the new path. But how to that, you have to ask someone else.
   
    - -
    Regards,
    Marc
   
   
    > On 1 feb. 2017, at 23:59, French, Shelane <[hidden email]> wrote:
    >
    > So I need to put redirects in from one server to another and from a wiki to confluence. The links are essentially the same, but there are a couple of differences.
    >
    > I need a link like:
    > https://oldserver.com/index/Quick_Lists
    >
    > to redirect to this:
    > https://newserver.com/display/SCS/Quick+Lists
    >
    > The underscore gets converted to a + and the path is replaced.
    >
    > Anyone particularly good at these?
    >
    >
    > Shelane French
    > Workforce Enablement
    > Livermore Information Technology
    >
    >
    > #############################################################
    >
    > This message is sent to you because you are subscribed to
    >  the mailing list Lasso [hidden email]
    > Official list archives available at http://www.lassotalk.com
    > To unsubscribe, E-mail to: <[hidden email]>
    > Send administrative queries to  <[hidden email]>
   
   
    #############################################################
   
    This message is sent to you because you are subscribed to
      the mailing list Lasso [hidden email]
    Official list archives available at http://www.lassotalk.com
    To unsubscribe, E-mail to: <[hidden email]>
    Send administrative queries to  <[hidden email]>
   


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [OT] Apache redirect match

stevepiercy
In reply to this post by French, Shelane
You will need to do something like either of these two examples,
where you use an external program to replace the _ with +.
http://stackoverflow.com/questions/2105009/mod-rewrite-replace-all-underscore-with-hyphen/2105068#2105068
https://httpd.apache.org/docs/trunk/es/rewrite/rewritemap.html#prg

You could use any programming language that supports text
transformations.  sed is probably easier to understand than perl.

--steve


On 2/1/17 at 10:59 PM, [hidden email] (French, Shelane) pronounced:

>So I need to put redirects in from one server to another and
>from a wiki to confluence. The links are essentially the same,
>but there are a couple of differences.
>
>I need a link like:
>https://oldserver.com/index/Quick_Lists
>
>to redirect to this:
>https://newserver.com/display/SCS/Quick+Lists
>
>The underscore gets converted to a + and the path is replaced.
>
>Anyone particularly good at these?
>
>
>Shelane French
>Workforce Enablement
>Livermore Information Technology
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [OT] Apache redirect match

Bil Corry-3
In reply to this post by French, Shelane
Assuming you're using mod_rewrite, this is how you can do it:

RewriteRule ^/index/([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$
/index/$1+$2+$3+$4+$5
RewriteRule ^/index/([^_]*)_([^_]*)_([^_]*)_([^_]*)$ /index/$1+$2+$3+$4
RewriteRule ^/index/([^_]*)_([^_]*)_(.*)$ /index/$1+$2+$3
RewriteRule ^/index/([^_]*)_(.*)$ /index/$1+$2
RewriteRule ^\/index\/(.+)$ https://newserver.com/display/SCS/$1
[R=301,QSA,L]

That allows up to five words separated by underscores.  If you have more,
you'll have to keep adding rewriterules until you have covered them all.

- Bil


On Wed, Feb 1, 2017 at 3:59 PM, French, Shelane <[hidden email]> wrote:

> So I need to put redirects in from one server to another and from a wiki
> to confluence. The links are essentially the same, but there are a couple
> of differences.
>
> I need a link like:
> https://oldserver.com/index/Quick_Lists
>
> to redirect to this:
> https://newserver.com/display/SCS/Quick+Lists
>
> The underscore gets converted to a + and the path is replaced.
>
> Anyone particularly good at these?
>
>
> Shelane French
> Workforce Enablement
> Livermore Information Technology
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Loading...