View previous topic :: View next topic |
Author |
Message |
zeltus -
Joined: 23 Sep 2006 Posts: 6
|
Posted: Fri Dec 05, 2008 10:32 am Post subject: redirect problem.. |
|
|
Altho' I can (just about) cope with Apache Rewrite stuff, I'm getting confused translating to the Abyss Way. I hope someone here can help.
I want to do this
Code: | if REQUEST_URI ~ ".*zeltus.eu/secret.*"
then
force redirect to "http://zeltus.eu/public/index.html"
fi |
But, despite the help docs, I'm unsure what the Virtual Path Regular Expression box is for, nor the difference between "Perform an internal redirection" and "Perform an external redirection"
The rule itself seems to be simple...
Code: | REQUEST_URI Matches with .*zeltus.eu/secret.* |
but I've put it here in case I'm misunderstandfing that as well!
As ever, any help gratefully received.
Cheers
Bill |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Fri Dec 05, 2008 4:04 pm Post subject: |
|
|
Hi Bill.
If you're trying to match any URI that begins with /secret
the virtual path regular expression would be:
Case-sensitive: I would uncheck this
If rule matches: Perform an external redirection
Redirect to: http://zeltus.eu/public/index.html
Append query string: doesn't matter (just leave checked)
Escape redirection location: doesn't matter (just leave checked)
Status code: 301 - Moved Permanently
This rule would redirect the following URIs
/secret.txt
/secret.html
/secret/
/secret/anything.php
/secret
Does that give you what you're looking for?
BTW, as for what domains this regex works with will depend on what domains are setup for this host in Abyss. So, of course, I'm assuming the host is already set up to work with zeltus.eu. _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
zeltus -
Joined: 23 Sep 2006 Posts: 6
|
Posted: Sat Dec 06, 2008 10:20 am Post subject: |
|
|
Thanks for the help... most of it is clear now except
a) shurelee REQUEST_URI is populated witha full URI string i.e. "http://zeltus.eu/secret.html" or similar? Or does Abyss work differently? (is there a way to log or otherwise, "see" what Abyss is seeing, for diagnostics
b) what is the Virtual Path Regular Expression used to compare against? i.e. what is the string that Abyss receives that it then can use this RE to check against?
Other than that, it's all going swimmingly well. Much thanks.
Bill |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
Posted: Sun Dec 07, 2008 12:24 am Post subject: |
|
|
zeltus wrote: | a) shurelee REQUEST_URI is populated witha full URI string i.e. "http://zeltus.eu/secret.html" or similar? Or does Abyss work differently? (is there a way to log or otherwise, "see" what Abyss is seeing, for diagnostics |
Incorrect. The zeltus.eu is found in the HTTP_HOST variable, not REQUEST_URI. You can see all the variables Abyss sees by turning on logging. Click 'edit' for advanced parameters on the URL rewriting page. Turn on 'Log variables'. Note: this file will get big very quickly! Turn it off as soon as you can.
You can get more familiar with those variables if you have PHP installed. Make a simple PHP file that looks like this:
Code: | <?php
foreach($_SERVER as $var => $string) {
echo "{$var} = {$string}";
}
?> |
zeltus wrote: | b) what is the Virtual Path Regular Expression used to compare against? i.e. what is the string that Abyss receives that it then can use this RE to check against? |
The virtual path regex is compared against the REQUEST_URI. If it matches, the rewrite rule is acted upon. _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
|