rewrite

nginx rewrite for clean urls

What I'm trying to accomplish, is to have people who go to: http://www.mydomain.com/$SEARCH-QUERY/$PAGE-NUMBER to redirect to search.php?query=SEARCH-QUERY&page=PAGE-NUMBER I just figured out how to install nginx and configure php-fpm, mysql and everything, but now I'm a bit confused over the rewrites. Here's what I have, that doesn't a...

Save HTTP_REFERER with mod_rewrite?

Hi everybody, actually I'm trying to pass referers inside the .htaccess. What I'm trying to do is that the referer value shall be send to a PHP script where this value will be saved to a databse. In some cases (depending on the referer) the image shall be blocked (hot linking) and in some other cases the image shall be shown normally. B...

Intelligencia Url Rewrite doesn't work on iis6 - Message Error: Page not found 404

I have the same problem on shared hosting, on local development machine my website works fine with intelligencia url rewrite, on iis6 it doesn't work and i have error "HTTP 404 Page not found" because i think it ingore rewriting rules on my web.config. intelligencia dll is on directory "bin" of my website i paste here my rules: <rewri...

Rewrite logic breaking?

Hello, I have the following rewrite logic in my vHost and everything seems to be working in regards to redirecting subdomains, but as soon as I add a path to the URI I'm getting an error in my apache_error.log. Here is the rewrite logic: RewriteEngine On # Remove the www alias RewriteCond %{HTTP_HOST} ^www\.13labs\.net$ [...

How can I remove a file from git using filter-branch making it so I cannot still git grep the contents?

Hi, I've been trying really hard to remove a file with sensitive data from my git repository using this excellent page (among others): http://help.github.com/removing-sensitive-data/ the primary line being: git filter-branch --index-filter 'git rm --cached \ --ignore-unmatch FileWithSecrets.java' HEAD However even when I follow...

htaccess - Rewriting requests for subdomain to a folder, with query string

Hi, I'm trying to get a subdomain rewrite working using an Apache htaccess file and need some help please. I am trying to get requests for http://xyz.example.com internally handled as if the user had requested http://example.com/xyz so the user does not see this URL in their address bar - they see the subdomain version. This is slight...

git: rewrite history: reorder and merge commits

Hi, Current situation: origin/mybranch --- A1 --- B1 --- A2 --- B2 --- A3 --- B3 mybranch I want to clean that history up (A1 to B3), esp. since I have not pushed it anywhere yet and because I want to prepare a patch which just those B*. What I want is: origin/mybranch --- A1+A2+A3 --- B1+B2+B3 mybranch I probably will not pu...

Multiple IIS7 URL Rewrite rules

I'm trying to write IIS7 URL Rewrites rules that do two things: If a request is to http, force it to https If the url has a "www" in it, remove it and redirect to different url In both cases I want to redirect to https://my.domain.com (substitute for real domain name) I have no problem with the http to https rule. Also, the case of...

.htaccess rewrite, how do I do it for this senario?

Hi there, I would like to have eg. www.domain.com/api/json/implode/abc/and/a/b/c... equal to www.domain.com/api/jason/?method=implode&key=abc&param1=and&param2=a&param3=b&param4=c... cheers James ...

& symbol encoded to %2526 in url

I need to replace the encoded value for the & sign in my url so the search query is successful. Im struggling to copy a similar method from the solution in this post for a query string such as below. lovelakedistrict.com/result/?q=Brookfield+Bed+%2526+Breakfast I want it to be like so lovelakedistrict.com/result/?q=Brookfield+Bed+&+Br...

How to rewrite location in nginx depending on the client-browser's language?

Hello all. How to rewrite location in nginx depending on the client-browser's language? For example: My browser accept-language is 'uk,ru,en'. When I request location mysite.org nginx must forward to mysite.org/uk How to do it? Thanks. ...

How to rewrite /foo-bar to foo-bar.html but /foo/bar to foo-bar.html using mod_rewrite?

How to rewrite /foo-bar to foo-bar.html but /foo/bar to foo--bar.html using mod_rewrite? In other words, replace all slashes in the request URI with --, then append .html. I wrote the following code: RewriteEngine On RewriteBase / # Take care of /foo/bar and /foo-foo/bar-bar RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_F...

How i can translate uppercase to lowercase letters in a rewrite rule in nginx web server?

I need to translate the address: www.example.com/TEST in ---> www.example.com/test ...

need to rewrite for a mobile controller in Kohana

I am trying to rewrite in htaccess mobile.domain.com/mobile/function into mobile.domain.com/function I thought the below would work but it thinks that the function is a controller. # Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase / # Protect hidden files from being viewed <Files .*> Order Deny,Allow De...

ASP.NET C# - Context.RewritePath in Global.asax Makes my site super slow.

I have multiple domain names, all pointing to the same wwwroot. www.domain1.com www.domain2.com www.domain3.com my folders look like this: /domain1-folder -->/domain2-folder -->/domain3-folder I use the global.asax as following: protected void Application_BeginRequest(Object sender, EventArgs e) { if (Request.Url.Host == "...

WordPress: Custom URL rewrite with parameters

I have a WordPress-Installation with the permalink strukture /%postname%/ Now I'm working on a solution to include static html-pages into the WP-Framework. I am using a WordPress-page with the name "html" (page-html.php) to manage the include. I would hand over the the old html-filename and path as a parameter to the page. With the he...

mod_rewrite: How to search and replace characters in a query string?

Possible Duplicate: Rewriting an arbitrary number of path segments to query parameters I want to replace every = and & in my %{QUERY_STRING} with a / via mod_rewrite Example: www.mydomain.com/path/?value=1&value=2 should become www.mydomain.com/path/value/1value/2/ No matter, how many values are in the url and how they ar...

rewrite apache to nginx

this is my first time with nginx rewrite, who can help me convert those rules to nginx sintax? RewriteRule (economics|sport|gossip|aboutus)+$ index.php?section=$1 RewriteRule (register)+$ $1.php?%{QUERY_STRING} RewriteCond %{QUERY_STRING} ^p RewriteRule (economics|sport|gossip)/+$ articles.php?section=$1&%{QUERY_STRING} thank you ...

Is R "that bad" that it should be rewritten from scratch?

In the past week I've been following a discussion where Ross Ihaka wrote: I’ve been worried for some time that R isn’t going to provide the base that we’re going to need for statistical computation in the future. (It may well be that the future is already upon us.) There are certainly efficiency problems (speed and memory...

Copy objects in scala but changing "children" for rewriting

In kiama a generic "dup" method is defined which copies Product objects and applies a given function to each of the elements of the Product in order to support rewriting of Terms: /** * General product duplication function. Returns a product that applies * the same constructor as the product t, but with the given children ...