redirect problem..

 
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting
View previous topic :: View next topic  
Author Message
zeltus
-


Joined: 23 Sep 2006
Posts: 6

PostPosted: Fri Dec 05, 2008 10:32 am    Post subject: redirect problem.. Reply with quote

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 View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Fri Dec 05, 2008 4:04 pm    Post subject: Reply with quote

Hi Bill.

If you're trying to match any URI that begins with /secret

the virtual path regular expression would be:
Code:
/secret(.*)

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 View user's profile Send private message Visit poster's website
zeltus
-


Joined: 23 Sep 2006
Posts: 6

PostPosted: Sat Dec 06, 2008 10:20 am    Post subject: Reply with quote

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 View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Dec 07, 2008 12:24 am    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group