Mod_rewrite - URL rewrite based upon HTTP_REFERER


 
Thread Tools Search this Thread
Top Forums Web Development Mod_rewrite - URL rewrite based upon HTTP_REFERER
# 1  
Old 01-23-2014
Mod_rewrite - URL rewrite based upon HTTP_REFERER

Hello,

I have added following rewrite cond and rewrite rules but it does not work.

Code:
RewriteCond %{HTTP_REFERER} ^http://192\.168\.1\.150/categories/.*$ [NC]
RewriteRule ^(.*)$ http://www.blahblah.com/


When I hit url : http://192.168.1.150/categories/881-Goes?page=7 in my browser - it loads and url does not rewrite to http://www.blahblah.com]eBags - Shop Bags and Accessories - Free Shipping - blahblah

Moderator's Comments:
Mod Comment removed links to external commercial site... this post could be interpreted as a kind of clever spam.. posting links in the guise of a problem to be solved... anyway, links removed!


Here are logs:

Quote:
192.168.x.yy - - [23/Jan/2014:06:46:55 +0000] "GET /categories/881-Goes?page=7 HTTP/1.1" 200 50167 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.10 Chromium/14.0.835.202 Chrome/14.0.835.202 Safari/535.1"

192.168.x.77 - - [23/Jan/2014:06:46:58 +0000] "GET /categories/881-Goes?page=7&format=js HTTP/1.1" 200 309 "http://192.168.x.zz/categories/881-Goes?page=7" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/11.10 Chromium/14.0.835.202 Chrome/14.0.835.202 Safari/535.1"
Thanks
# 2  
Old 01-23-2014
Using HTTP_REFERER is not correct for what you describe and show in the logs.
# 3  
Old 01-23-2014
Could you please advise what is appropriate.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Botnet Map from $_SERVER[HTTP_REFERER]

4000 node Botnet derived from PHP superglobal $_SERVER mapped with Google Maps Engine. https://www.unix.com/members/1-albums112-picture640.png total ips 54945 unique ips 4000 unique countries 64 (2 Replies)
Discussion started by: Neo
2 Replies

2. 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

3. Shell Programming and Scripting

API Based URL Parsing

Hi Friends, We have a situation where we need to pass API based URL which will return XML response ,and I need to convert those XML response to a delimited flat file. url.txt -- will have http://xyz.com/beta/xxx.xml?isDRR=True&city=London&province=England... (1 Reply)
Discussion started by: rakesh5300
1 Replies

4. 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

5. Shell Programming and Scripting

Using md5sum to name file based on URL

I am trying to download a file and make the filename of the file be the md5sum of the URL. I know to use wgets to download the file but I do not know how to do the rest...any help would be appreciated. (2 Replies)
Discussion started by: The undertaker
2 Replies

6. 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

7. Web Development

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 http://SUB.DOMAIN.COM/showAssignment/7bde10b45efdd7a97629ef2fe01f7303/jsmodule/Nevow.Athena The ID in the middle is always random due to the cookie. I... (5 Replies)
Discussion started by: EXT3FSCK
5 Replies

8. Web Development

Apache mod_rewrite: from 'friendly' url to actual path

I'd like to translate a friendly url such as: http://www.xxxyyyzzz.com/page/12345678/ to: http://www.xxxyyyzzz.com/page/12/34/56/78/ Seems simple enough, but I cannot figure out how. Any one done this before? (2 Replies)
Discussion started by: markericksen
2 Replies

9. 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

10. 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
Login or Register to Ask a Question