rewrite

How to MapPath in an IIS7 Rewrite Provider?

Hi, I am using the rather excellent IIS7 Rewrite module (V2), and want to create a custom RewriteProvider that rewrites differently depeneding on whether the physical file exists. I have successfully created a provider, as in this tutorial: http://learn.iis.net/page.aspx/804/developing-a-custom-rewrite-provider-for-url-rewrite-module/ ...

Zend Framework - Router Rewrite with Regex

Hi, I have been trying to shortern this route: http://abc.localhost/user/view/index/id/1 to this: http://abc.localhost/user/1 with the following portion of code in my bootstrap but I keep getting an error stating that the 'Reversed route is not specified', any ideas why? $route = new Zend_Controller_Router_Route_Regex( 'user/(\d+...

HOW to rewrite links like this?

I have a link, let's say: http://site.com/profile.php?id=1 ....In a normal mode, with a normal rewrite I'd have something like: http://site.com/profile/1 . But,...What I want is.....how can I get from the database the username that belongs to the user with the id 1 and make the url http://site.com/profile/FinalDestiny ? Thanks, ...

URL rewriting apache

I would like to rewrite two urls on my website so as they are more search engine friendly. How can I do this in my .htaccess? For the first I tried this, but got 404 errors: RewriteRule ^research/([0-9][0-9])$ /research/$1/ [R] RewriteRule ^research/([0-9][0-9])/$ /urt.php?func=viewresearch&rid=$1 RewriteRule ^research/([0-9])$ /resea...

Problem with ReWrite Rule

Following problem, i want to route all requests from http to htts, after this route all requests wich cause an 404 to route.php script. But i dont know, how to tell mod_rewrite to 1st use rule one, and than rule two? My Rule looks like this: RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) ht...

Automatic URL Rewriting

I have created .htaccess file. The original URL is: http://example.com/folder/page.php?page=1&ipp=All&link=view_link Redirected : http://example.com/folder/page/1/All/link.html Redirecting works correctly.But,Now the problem is , it will be redirected only if i give the rewrited URL manually. But it should do automatically...

URL rewrite - Automatically - not manual

I have written a rule for redirecting in .htaccess file its redirecting for some pages , if we give that link manually.. but what i want is ,it should redirect automatically.... My requirement is : Instead of this link, links.php?page=1&ipp=All&exchange=adddata It should be redirected automatically http://example.com/folder1/links/...

SQL 2005 database - select by id or select by title?

I'm creating some url rewriting for asp.net. Now I am tobbing if I should include the id in url or just the title. Do you guys know if it's a significant performance hit to lookup an item by title instead of id? ...

asp.net routing multiple RouteValueDictionary items

Hi all, I'm experimenting with asp.net routing (using webforms). I got it to work fine and I retrieve an url like this: public static string FormatReviewUrl(string title) { return RouteTable.Routes.GetVirtualPath(null, "Review", new RouteValueDictionary { { "Item", title } }).VirtualPath; } Problem however is my u...

Basic Static-to-Static Rewrite (or Redirect) via htaccess or httpd.conf

We are moving from one site language/CMS (coldfusion/custom) to another (PHP/Drupal) and need to have some of our old pages redirected to new ones. I have access to both the .htaccess and httpd.conf (and apache2.conf) as this is a vps on Linode. Most of them cannot be done via regular expression (they contain GUIDs in the URL) and we're...

I have a problem in rewrite code in .htaccess

AuthType Basic AuthName "http://localhost/domain/adminpanel" AuthUserFile http://localhost/domain/adminpanel/.htpasswd Require valid-user Options +FollowSymlinks RewriteEngine on RewriteRule ^([^/]+).html?$ $1.php [L] i use this code in .htaccess file but i am not able to get extension .html it shows only .php ...

Trying to map subdomain to another using ISAPI Rewrite on IIS 6

Hi all, I've been experiementing with URL rewriting in IIS 6 and 7. On IIS 6, I've been using ISAPI Rewrite 3 and am trying to map URLs for one subdomain to another e.g. http://subdomain1.domain.com/* would be mapped to: http://subdomain2.domain.com/* I've tried to achieve this using: RewriteEngine on RewriteCond Host: subdomain1....

apache mod-rewrite removing www from url

I want to remove www. from my site url. I have added this to .htaccess: RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L] It works if I type www.domain.com/x but not if I type www.domain.com/x/y. The rewrite "eats" the x value. Thanks for your help. ...

Checking for a pattern and rewriting in the same operation in nginx config files

I make use of version numbers to cache static files, with URLs like this: http://example.com/css/example.v123.css Combined with a nginx config snippet like this: # Serve static files directly location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ { root /var/www/example.com/static/; access_log off; if ($request_filename ~* ^(.*\....

Rewrite .php to .aff and treat .aff as php

Hello, On my website I have an affiliates/ folder. Inside that I have showgames.php I want to be able to access the file as www.website.com/affiliates/showgames.aff Inside affiliates folder,I placed this .htaccess AddType application/x-httpd-php .php .aff RewriteEngine on RewriteBase / RewriteRule ^(.*)\.php$ $1.aff [R=permanent] ...

What is the cleanest way to extend this design for tree-rewriting?

I have a tree of objects, where each object has a std::vector of pointers to its children. The class of the object has a rewrite() method that is recursively applied to alter the object and its children, typically with the following transformations, where [N] is the object being rewritten and (M) is the element that rewrite() returns: ...

IIS 7.5 - Rewrite Module Post Back / QueryString Issue

The URL rewrite module doubles the query string in IIS 7.5 on a post back (when appendQueryString="true" which sometimes must be...). Below is an example a rule that works as expected in IIS 7.0 and is in use in our production environment. This is a big issue for us since we are attempting to migrate to a new environment running IIS 7....

About the syntax of module rewrite

i have some question about the syntax of module rewrite. i would like to know how to write a rule to not include/contain some file? For example: Directories structure: / /home.php /profile.php /pages /pages/index.php /pages/.htaccess About the /pages/index.php content: <?php include_once "../home.php" ?> About the /home.php cont...

Is this the "one in ten" time to rewrite?

I'm very much against rewriting an application if it can be avoided. I understand the rule that 9 times out of 10, it's better to refactor, but I'm in a situation where it might be the one time in ten, and I'm looking to find that line. The current situation is: I took over the maintenance of a VB6/SQL application. The total lines of...

Shimmie2 on nginx (Rewrite)

Hello guys, I'm porting the rewrite rules of shimmie2 to nginx and ran across a problem: From the first impression it worked quite well, but when you try to view the image (I mean via right-click menu in your browser) you end up with stuff like this, instead the original image: ÿØÿà�JFIF��H�H��ÿÛ�C� ÿÛ�CÿÀ���À�ÿÄ�����������...