rewrite

mod rewrite problem

Hi, I am trying to redirect my pages using URL: RewriteRule ^(.*)/content/(.*)/?(.*)\.html$ browse.php?s=$1&c=$2&l=$3 [NC,L] For 2 parameters it works fine but when I passes 3 parameters it merges the 2 and third. Correct output is as follow (2) parameters: Array ( [s] => wallpapers [c] => Global_Celebrities [l] => Nicole1); ...

Override ~ behaviour in controls

Quick backstory: I'm making a "framed" version of my site that has a different master page than normal (one suitable for iframing). It's accessed by mysite.com/Framed/whatever, instead of mysite.com/whatever. This is rewritten in IIS to mysite.com/whatever?framed=true. That works fine. The issue I'm having is that all the links are rela...

.htaccess 301 redirect for all https to http EXCEPT ONE PAGE

Here is the code I have currently in my .htaccess file: Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I know jack about rew...

ISAPI Rewrite rule help ( .html -> .aspx )

Hello, Recently I'm working on a refactor project from asp to asp.net 3.5. There are lots of .html file uses .inc file for the header and footer in the old site, and needed to be converted to .aspx uses master page. My problem is, for search engine and for bookmark those old pages are all gone Therefore I need to redirect the old .html...

PHP/Apache REQUEST_URI different behaviour?

I am moving websites from one server to another. Both are on a similar variant of Centos 5 x64 with Apache 2.2 and PHP 5.2.X. Some of my scripts including Wordpress are behaving incorrectly. It turns out the issue is the difference between the REQUEST_URI global: On the older server: REQUEST_URI = /phpinfo.php On the new server: REQUES...

Rewrite rule help for several languages

Hi. Could anyone help me here with this rewrite rule please? From this http://www.SOMEDOMAIN.com/en/somefolder/ To this http://www.SOMEDOMAIN.com/frontend/somefolder/?idLang=2 From this http://www.SOMEDOMAIN.com/es/somefolder/ To this http://www.SOMEDOMAIN.com/frontend/somefolder/?idLang=3 (...) And for several other languages...

Need help with rewrite rules with sub folders please.

We've created a jkMount in Tomcat named "shopping" and then applied this rewrite rules on Apache: # when Query String RewriteCond %{QUERY_STRING} !^$ RewriteRule ^pt/?([a-zA-Z0-9\./_-]+)? $1?idLang=1&%{QUERY_STRING} [NC,PT,L] RewriteRule ^en/?([a-zA-Z0-9\./_-]+)? $1?idLang=2&%{QUERY_STRING} [NC,PT,L] RewriteRule ^es/?([a-zA-Z0-9...

CakePHP in a subdirectory using nginx (Rewrite rules?)

I managed to get this to work a while back, but on returning to the cakephp project I had started it seems that whatever changes I've made to nginx recently (or perhaps a recent update) have broken my rewrite rules. Currently I have: worker_processes 1; events { worker_connections 1024; } http { include mime.types; ...

What should my Nginx rewrite rules be for Rails with Passenger for page caching in a subdirectory?

I'm using Nginx 0.7.64, Passenger 2.2.9, Rails 2.3.5. I have my page caching directory set to /public/cache, and I'd like to be able to serve cached pages when requested over HTTP, but always hit the Rails app when requested over HTTPS. The bulk of my config looks like this: server { listen 80; server_name website.com www.website....

TM symbol not displaying correctly on redirected URL

I have a url that redirects to a page on my main site. For some reason, when I access through the rewritten URL, a TM symbol is showing up as â¢, but when I access through the main site, it shows up correctly. The urls are http://waterlessmilkwarmer.com/ and http://www.medelabreastfeedingus.com/milk-warmer so you can see what's happenin...

Htaccess Modify String then Redirect 301

Hi, I'm trying to rewrite the following into htaccess using - redirect 301 redirect "mysite.com/longname/{20 character string}" to "mysite.com/shortname/{10 character string}" basically to redirect the "longname" to "shortname" and cut the "20 character string" to the first 10 characters so when I go to mywebsite.com/longname/aaaaabb...

301 redirect match problem

Ok I am serving two domains off of one box. The domains are: www.old.org and www.new.com. As it is now, all of the files and dirs are the same on both domains. I want to make it so that IF someone goes to www.old.org/folder_a/file_b.php they are 301'ed to www.new.com/folder_a/file_b.php. I've already tried in the htaccess: Redirect...

Removing private information from old Git commits

I have a project versioned with Git that I'd like to make open source, but it has some private information in it that is specific to the environment in which it was originally used. I'm going to change the information in question to load from a config file which is not included in the repository. I realize I should have done this in the ...

Shortlinks RewriteRule Regex

Hi, I'm using Apache/PHP to support shorlinks to documents and I'm having trouble with the Regex to redirect correctly. My links take the form of 8 letters/numbers, something like '1abc45fd', I would like to have them redirect to /shortlink.php?link=1abc45fd but it's just not working correctly. I'm using the following expression: "Rewr...

Nginx server matching too many URLs

Hello, I've got a domain example.com and an "alternative" of some-example.com. I'm trying to direct traffic from some-example.com to example.com using a simple server declaration in nginx as follows: server { listen 80; server_name some-example.com; rewrite ^/(.*) http://example.com/$1 permanent; } I'm not 100% sure if thi...

ASP.NET Multiple Page_Load events with URL Rewriting

Hello All, Im using intelligencia urlrewriter as my url rewrite module. I have one very strange problem which only occurs when an url is rewritten but to make it more fun, not on all rewritten pages. Edit: Forgot to tell you what's the problem boing boing. the problem is that my Page_Load event gets fired 2 times. This is how my f...

How to perform link rewriting with a .NET Regex?

I need to use C# Regex to do a link rewrite for html pages and I need to replace the links enclosed with quotes (") with my own ones. Say for example, I need to replace the following "slashdot.org/index.rss" into "MY_OWN_LINK" However, the actual link can be of the form "//slashdot.org/index.rss" or "/slashdot.org/index.rss" whe...

Multiple rack apps on nginx + passenger, one as root, the other not...config help

So I've got two apps I want to run on a server. One app I would like to be the "default" app--that is, all URLs should be sent this app by default, except for a certain path, lets call it /foo: http://mydomain.com/ -> app1 http://mydomain.com/apples -> app1 http://mydomain.com/foo -> app2 My two rack apps are installed lik...

Help needed with an IIS7 rewrite rule

I have a shared hosting account on Winhost and I have multiple domains pointed at the site root that I'm trying to operate as different sites, but with the same MVC application, thus: www.domain1.com/1/products/123 www.domain2.com/2/products/456 www.domain3.com/3/products/789 The base route is therefore: routes.MapRoute( "Defaul...

Java While-Loops

So while rewriting some code, I came across something along the lines of: Method 1 while ( iter.hasNext() ) { Object obj = iter.next(); if ( obj instanceof Something ) { returnValue = (Something) obj; break; } } I re-wrote it as the following without much thought (the actual purpose of the re-write was for...