rewrite

IIS 7.0 URL Rewrite domain rule

Hi, I want to archive following things using URL Rewrite/Redirect on IIS 7.0 1) http://(www.)xyz.com/ (-with or without preceding www) => 301 => http://www.xyz.com.in/ (- must have preceding www) 2) http://(www.)xyz.com/example-page (- with or without preceding www) => 301 => http://www.xyz.com.in/example-page (- must have p...

Create custom rewrite rule for my WordPress plugin

I'm writing a plug-in for WordPress which in fact will be a separate ordering module (it will be placed in an IFRAME on the site I'm developing as well as others) but with its admin tied into WordPress. I wrote the administration part without too much hassle, however I'm having trouble with the front-end. First of all I'd like my script...

REALLY basic mod_rewrite question...

I am trying to use SEO-friendly URLs for a website. The website displays information in hierarchical manner. For instance, if my website was about cars I would want the URL 'http://example.com/ford' to show all Ford models stored in my 'cars' table. Then the URL 'http://example.com/ford/explorer' would show all the Ford Explorer Model...

[SOLVED] Apache2 + RewriteMap + Python -- when returning 'NULL', apache hangs

[SOLVED: See solution below.] I'm having a problem writing a RewriteMap program (using Python). I have a RewriteMap directive pointing to a Python script which determines if the requested URL needs to be redirected elsewhere. When the script outputs a string terminated by a linebreak, Apache redirects accordingly. However, when the s...

Nginx rewrite for URI querystring value

I changed my website platform and i am now getting hits from google pointing to the old location of tag searches on my site. Basically i need to point: http://www.website.com/articles/Subject%3Alist=Music-Oldies&review_state=published to: http://www.website.com/tags/Music-Oldies ..in my Nginx website file. Only the tag 'Music-o...

ASP.NET MVC 2 and custom httpModule precedence

I have a custom HttpModule rewrite engine in an existing web application project that maps urls of the form /tom/dick/harry/.../.../... to a hierarchical navigation system stored in a database, ultimately resulting in a HttpContext.Current.RewritePath() call to the .aspx page that the requested path resolves to. I'm interested in mixi...

Rewriting C# code in F#

Just messing about with F# and I was trying to create a basic Lagrange Interpolation function based on this C# version (copied from a C++ wiki entry): double Lagrange(double[] pos, double[] val, double desiredPos) { double retVal = 0; for (int i = 0; i < val.Length; ++i) { double weight = 1; ...

dd conv=sync and flushing

Hi Will the conv=fsync flag when using dd, flush the data directly? /Jesper ...

Nginx rewrite non-www-prefixed domain to www-prefixed domain

I see the Nginx HttpRewriteModule documentation has an example to rewrite a www-prefixed domain to a non-www-prefixed domain: if ($host ~* www\.(.*)) { set $host_without_www $1; rewrite ^(.*)$ http://$host_without_www$1 permanent; # $1 contains '/foo', not 'www.mydomain.com/foo' } How can I do the reverse-- rewrite a non-www-prefi...

htaccess rewrite not working for all rules

This is a very strange problem, and I just hope that I can clearly explain it. Basically, we made a major update on a client site today, and needed to update some rewrite rules in the htaccess to accomodate the new structure, etc... So, where we originally had things like: RewriteRule ^/resources/?$ index.php?id=resources RewriteRule...

Url Rewriting Help

RewriteEngine on RewriteCond %{REQUEST_URI} !^/index\.php RewriteRule ^(.*)$ index.php?q=$1 [L] This should rewrite any url to index.php?q={url}, and it's working. Anyway, http://www.domain.com/ just show a blank page. How can I rewrite / to index.php? (http://www.domain.co.il/index.php dosen't show a blank page..) BTW: This code's re...

Nginx rewrite rule: check for nonexistant files and folders

I'm trying to set-up nginx rewrite rules as the following: Original structure: domain.com/index.php?site=project Now I tried to mask it using the nginx rewrite engine: if (-f $request_filename) { break; } if (!-f $request_filename) { rewrite ^/(.+)$ /index.php?site=$1 last; break; } How do ...

IIS7 rewrite for REST not working

I have a REST service and am trying to remove the .svc - a common task/problem. The application on the server is in a virtual directory under the default website (not sure if this is important) I have installed the IIS Rewrite Module and have tried to create a rewrite rule for this. http://blah.me.com/here/thingys/get?id=1111 to rew...

IIRF redirect combine rules?

I have 3 "rules". One to make sure URLs are lowercase another to include a slash at the end of directories, and a 3rd to force access to index.html pages to be thru the directory instead. The problem w/ how I have it is, sometimes this is causing multiple 301 redirects. I'd really like each rule to apply in turn and then if neccessary r...

Apache Mod Rewrite: RewriteRule with L argument. What's wrong?

Hi, I'm developing a php application and I have a little issue with Apache and Mod Rewrite. Anyone knows what's wrong here?: RewriteEngine on RewriteBase /mysite/ RewriteRule ^css\/css\.css css/css.php [L] RewriteRule ^js\/js\.js js/js.php [L] RewriteRule !^img\/.* index.php When I put http://localhost/css/css.css appears index.php, m...

IIS7 URL Rewrite with dynamic subdomains.

My goal is to implement the following scheme using the subdomain and path as attributes: Use a wildcard DNS entry that routes any subdomain to the root site: Example: *.example.com ex: http://xyz.example.com to http://example.com Next I want to rewrite the requests to point to a specific page, passing both the subdomain and the req...

mod_rewrite rules for all web documents

I am in need of the rewrite rules and conditions to evoke a central PHP script for every and any web document requested on my server. Just to add, I do not want the PHP script to be evoked when requests are made for CSS, JS, PNG, GIF, JPG, and other media etc. I only want the script to be called for HTM, HTML and PHP documents in the roo...

COBOL Migrations Strategies?

Has anyone here been involved in any projects designed to eliminate COBOL or mitigate the risk of COBOL (for example, writing in-house compilers or using COBOL to generate NetBeans, etc.)? If so, what tools/strategies were adopted? Were you successful? What would you do differently? Anecdotal stories welcome. Just trying to understa...

Nginx location, alias, rewrite, root

I'm serving /foo/bar/ by way of proxypass and want to continue doing so. However, I would like to serve /foo/bar/baz.swf statically from say /var/www/mystatic/baz.swf and so forth. I was hoping that I could do something like location /foo/bar/(.*) { alias /var/www/mystatic/; } location / { proxy_pass ....; ...

Redirect query string parameters to individual domain names in apache

We have a client who has many branches around the UK. Some of their branches have their own sites with their own domain names. The client has a part built system where visiting: www.client.com/aboutus.php?id=branchId shows the About Us page for that particular branch. What I need is a way to map specific domains to their branchId (thi...