Sponsored Content
Top Forums Web Development Regex to rewrite URL to another URL based on HTTP_HOST? Post 302479028 by EXT3FSCK on Thursday 9th of December 2010 01:09:31 PM
Old 12-09-2010
Power Regex to rewrite URL to another URL based on HTTP_HOST?

I am trying to find a way to test some code, but I need to rewrite a specific URL only from a specific HTTP_HOST

The call goes out to

Code:
http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena

The ID in the middle is always random due to the cookie.

I want for that specific HTTP_HOST when it fetches the URL "http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena" , I want it to get

Code:
http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena.v2

Instead.

Is there a way I can do this with mod_rewrite, or regex?

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

url calling and parameter passing to url in script

Hi all, I need to write a unix script in which need to call a url. Then need to pass parameters to that url. please help. Regards, gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies

2. Shell Programming and Scripting

url calling and parameter passing to url in script

Hi all, I need to write a unix script in which need to call a url. Then need to pass parameters to that url. please help. Regards, gander_ss (1 Reply)
Discussion started by: gander_ss
1 Replies

3. Cybersecurity

APACHE rewrite / redirect URL

Hello. I have scenario where a Client send request to Server1. Server1 send request to Server2. Request are xmlHTTPRequest - need to get data (XML) from Server2 back to client. Trying to use APACHE proxy... Anyone can help? What to download / configure / ...? Thank you for your help. (1 Reply)
Discussion started by: ampo
1 Replies

4. Web Development

APACHE rewrite / redirect URL

Hello. I have scenario where a Client send request to Server1. Server1 send request to Server2. Request are xmlHTTPRequest - need to get data (XML) from Server2 back to client. Trying to use APACHE proxy... Anyone can help? What to download / configure / ...? Thank you for your... (2 Replies)
Discussion started by: ampo
2 Replies

5. Red Hat

Need some help on tomcat URL rewrite or mod_jk

I am trying to remove the context name from the url of my server. Current URL - http://www.domainname.com/MyApp/ What I need to make is to make it avaialble at - http://www.domainname.com/ I have already tried couple of things like below - RewriteEngine On RewriteCond... (0 Replies)
Discussion started by: rockf1bull
0 Replies

6. UNIX for Dummies Questions & Answers

Awk: print all URL addresses between iframe tags without repeating an already printed URL

Here is what I have so far: find . -name "*php*" -or -name "*htm*" | xargs grep -i iframe | awk -F'"' '/<iframe*/{gsub(/.\*iframe>/,"\"");print $2}' Here is an example content of a PHP or HTM(HTML) file: <iframe src="http://ADDRESS_1/?click=5BBB08\" width=1 height=1... (18 Replies)
Discussion started by: striker4o
18 Replies

7. Web Development

Append query string via URL rewrite in apache

Hi, Googled around but I couldn't find anything similar. I'm looking to do the following in apache.. if a user comes into the following URL. http://www.example.com/some/thing.cid?wholebunch_of_stuff_here keep the URL exactly as is BUT add &something at the very end of it. thanks in... (1 Reply)
Discussion started by: kmaq7621
1 Replies

8. Web Development

Mod_rewrite - URL rewrite based upon HTTP_REFERER

Hello, I have added following rewrite cond and rewrite rules but it does not work. RewriteCond %{HTTP_REFERER} ^http://192\.168\.1\.150/categories/.*$ RewriteRule ^(.*)$ http://www.blahblah.com/ When I hit url : http://192.168.1.150/categories/881-Goes?page=7 in my browser - it... (2 Replies)
Discussion started by: ashokvpp
2 Replies

9. Shell Programming and Scripting

Reading URL using Mechanize and dump all the contents of the URL to a file

Hello, Am very new to perl , please help me here !! I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file. below is the script which i have written so far , #!/usr/bin/perl use LWP::UserAgent; use... (2 Replies)
Discussion started by: scott_cog
2 Replies

10. UNIX for Beginners Questions & Answers

Regex for a valid URL

Hi guys, What is the regex to check for only valid URL from a file using grep? (2 Replies)
Discussion started by: Meeran Rizvi
2 Replies
ALTER 
DOMAIN(7) SQL Commands ALTER DOMAIN(7) NAME
ALTER DOMAIN - change the definition of a domain SYNOPSIS
ALTER DOMAIN name { SET DEFAULT expression | DROP DEFAULT } ALTER DOMAIN name { SET | DROP } NOT NULL ALTER DOMAIN name ADD domain_constraint ALTER DOMAIN name DROP CONSTRAINT constraint_name [ RESTRICT | CASCADE ] ALTER DOMAIN name OWNER TO new_owner ALTER DOMAIN name SET SCHEMA new_schema DESCRIPTION
ALTER DOMAIN changes the definition of an existing domain. There are several sub-forms: SET/DROP DEFAULT These forms set or remove the default value for a domain. Note that defaults only apply to subsequent INSERT commands; they do not affect rows already in a table using the domain. SET/DROP NOT NULL These forms change whether a domain is marked to allow NULL values or to reject NULL values. You can only SET NOT NULL when the col- umns using the domain contain no null values. ADD domain_constraint This form adds a new constraint to a domain using the same syntax as CREATE DOMAIN [create_domain(7)]. This will only succeed if all columns using the domain satisfy the new constraint. DROP CONSTRAINT This form drops constraints on a domain. OWNER This form changes the owner of the domain to the specified user. SET SCHEMA This form changes the schema of the domain. Any constraints associated with the domain are moved into the new schema as well. You must own the domain to use ALTER DOMAIN. To change the schema of a domain, you must also have CREATE privilege on the new schema. To alter the owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the domain's schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the domain. However, a superuser can alter ownership of any domain anyway.) PARAMETERS
name The name (possibly schema-qualified) of an existing domain to alter. domain_constraint New domain constraint for the domain. constraint_name Name of an existing constraint to drop. CASCADE Automatically drop objects that depend on the constraint. RESTRICT Refuse to drop the constraint if there are any dependent objects. This is the default behavior. new_owner The user name of the new owner of the domain. new_schema The new schema for the domain. NOTES
Currently, ALTER DOMAIN ADD CONSTRAINT and ALTER DOMAIN SET NOT NULL will fail if the named domain or any derived domain is used within a composite-type column of any table in the database. They should eventually be improved to be able to verify the new constraint for such nested columns. EXAMPLES
To add a NOT NULL constraint to a domain: ALTER DOMAIN zipcode SET NOT NULL; To remove a NOT NULL constraint from a domain: ALTER DOMAIN zipcode DROP NOT NULL; To add a check constraint to a domain: ALTER DOMAIN zipcode ADD CONSTRAINT zipchk CHECK (char_length(VALUE) = 5); To remove a check constraint from a domain: ALTER DOMAIN zipcode DROP CONSTRAINT zipchk; To move the domain into a different schema: ALTER DOMAIN zipcode SET SCHEMA customers; COMPATIBILITY
ALTER DOMAIN conforms to the SQL standard, except for the OWNER and SET SCHEMA variants, which are PostgreSQL extensions. SEE ALSO
CREATE DOMAIN [create_domain(7)], DROP DOMAIN [drop_domain(7)] SQL - Language Statements 2010-05-14 ALTER DOMAIN(7)
All times are GMT -4. The time now is 06:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy