Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Mod rewrite condition creates infiitinte redirect loop |
|
Author |
|
aarelovich
Joined: 29 Nov 2016 Posts: 1
|
Posted: Tue 29 Nov '16 14:28 Post subject: Mod rewrite condition creates infiitinte redirect loop |
|
|
I'm configuring an apache web server which is reached by the address http://register.conference.com. However I want to be able to redirect that to http://register.conference.com/registration
The way, I understand that I need to do this is with a RewriteCond followed by a RewriteRule.
This is what I've written.
Code: | RewriteCond %{HTTP_HOST} ^register.conference.com$
RewriteRule . http://register.conference.com/registration
|
This creates an infinite loop of redirections. But I don't know how to break it, because the redirection address is part of the RewriteCond. So how do I fix this?
Thanks for any help. |
|
Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7402 Location: EU, Germany, Next to Hamburg
|
Posted: Tue 29 Nov '16 15:59 Post subject: |
|
|
Add a second condition
Code: | RewriteCond %{HTTP_HOST} ^register.conference.com$
RewriteCond %{REQUEST_URI} !=/registration
RewriteRule . http://register.conference.com/registration |
|
|
Back to top |
|
|
|
|
|
|