Forum Moderators: phranque

Message Too Old, No Replies

Apache Redirect Permanent Special Characters

         

chittu

3:44 am on Mar 27, 2012 (gmt 0)

10+ Year Member



I'm trying to Redirect a large URL to a simple one using Permanent directive..

RedirectMatch permanent ^/$ http://saml.example.com/simplesaml/saml2/idp/SSOService.php?spentityid=https://www.sf.com&RelayState=https://pm4.sf.com/xi/ui/home/pages/home.xhtml

We want to access the above URL as http://saml.example.com.

It works fine in IE but doesn't work in FF and Chrome. The "&" is removed in FF &Chrome..

Is there any other way to get this working.. I'm a newbie with Apache.

[edited by: incrediBILL at 4:22 am (utc) on Mar 27, 2012]
[edit reason] exemplified URLs [/edit]

lucy24

4:42 am on Mar 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Uhm, your sample doesn't redirect a large URL to a small one. It redirects a small URL to an enormous one.

Go read up on mod_rewrite [httpd.apache.org]. You can't do what you want with mod_alias (Redirect by that name). And then read any 10 or 12 recent threads in this forum. Look for the boilerplate on query strings.

When it starts getting repetitive, you are ready to try making your own RewriteRule. Post it back here.

g1smd

7:07 am on Mar 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your rule is exactly backwards, and in any case RedirectMatch can't do what you want.

You need a RewriteRule, with a preceding RewriteCond to handle the query string.