rewrite

ASP.NET URL Rewriting

How do I rewrite URL's in ASP.NET? I would like users to be able to goto http://www.website.com/users/smith instead of http://www.website.com/?user=smith ...

URL without ID

I see often (rewritten) URLs without ID in it, like on some wordpress installations. What is the best way of achieve this? Example: site.com/product/some-product-name/ Maybe to keep array of page names and IDs in cache, to avoid DB query on every page request? How to avoid conflicts, and what are other issues on using urls without IDs? ...

When do you know it's time to rewrite an application

This is humbling, but probably something most can relate to. I am currently adding functionality to a PHP application I wrote for a client 2 years ago. In the interest of full disclosure, this was the first "real" application I ever built from the ground up, in the sense that I actually met with clients to determine and write a spec. ...

Rewrite or repair?

I'm sure you have all been there, you take on a project where there is a creaky old code base which is barely fit for purpose and you have to make the decision to either re-write it from scratch or repair what already exists. Conventional wisdom tends to suggest that you should never attempt a re-write from scratch as the risk of fail...

Rewrite of legacy code

My department is currently faced with the responsibility for the task of maintaining a rather large COBOL code base. We are wondering how to add new features to keep up with business needs. COBOL programmers are hard to come by these days, and we also think we would get higher productivity from using a more modern language like Java or C...

Licensing a rewrite from GPL to MIT

I've found a unmaintained program I have a need for, but it's not perfect, so I would like to fork it and to continue fixing it. The current version is licensed under the GPL (version 2 and up), but I would prefer to integrate my version with some other code I wrote, licensed under the MIT, and combine them all to a usable library. The...

When is it good (if ever) to scrap production code and start over?

I was asked to do a code review and report on the feasibility of adding a new feature to one of our new products, one that I haven't personally worked on until now. I know it's easy to nitpick someone else's code, but I'd say it's in bad shape (while trying to be as objective as possible). Some highlights from my code review: Abuse of ...

URL rewriting - international letters

How should I format URLs with special/international characters? Currently I try to make URLs "look good", so that: www.myhost.com/this is a test, do you know how? is converted to: www.myhost.com/this_is_a_test_do_you_know_how I know some international letters could be converted (ü = ue, æ = ae, å = aa), some characters could be re...

Best approach for redirecting a large number of old URLs to new URLs?

We are re-platforming for a client, and they are concerned about SEO. Their current site supports SEO friendly URLs, and so does the new platform. So for those, we are just going to create the same URL mapping. However, they have a large number of other URLs that are not SEO friendly that they want to permanently redirect. These do not f...

Cost of Rewriting a PHP application to Rails or Django

I am wondering your thoughts on doing a complete software rewrite. We realized after not long after we completed our software app that the framework was not going to scale well over time. For the record the framework was decided well before I got to the project. We are soon facing the reality that we will have to rewrite the entire app i...

Why doesn't url rewrite work?

In asp.net 3.5, I'm rewriting the url http://www.abc.com/archive/1108/harpersdecember to the following http://www.abc.com/article.aspx?docId=78 I'm using this code to do it: Context.RewritePath("/article.aspx?docId=78"); It works fine locally but when I upload to the remote web server, I get a 404 when trying to re...

ASP.NET URL rewriting for DB query from URL content without extension

I am trying to create a very simple ASP.NET application that presents information out of a datbase based on the URL, similar to a wiki, but in this case the site is read-only. An example of a url I'd like would be: http://www.foo.com/bar and then it would use "bar" as a SQL query parameter to show information from a database that matc...

Mod Rewrite rule to Zeus Server rule (Codeigniter)

Hi everyone, I'm about to go live with a Codeigniter powered site. I want to remove index.php from the url so that instead of this: http://www.mysite.com/index.php/controller I get something like this: http://www.mysite.com/controller So far, pretty straightforward. In the past I've used the mod-rewrite rule supplied by the Codeig...

Url rewrite with mod_jk

In a php application, I use the following rewrite rule: RewriteRule ^test-([0-9]+).html$ test.php?id=$1 After I access this by this rule: http://localhost/testphp/test-1.html I got the expected page, and the url in browser stays in the same: http://localhost/testphp/test-1.html But if I config the same rule with mod_jk: RewriteRul...

asp.net, url rewrite module and web.config

Hi, i'm using ASP.net with .NET 3.5 on IIS7 (Vista) with the URL Rewrite Module from Microsoft. This means, that i have a <system.webServer> <rewrite>...</rewrite> ... </system.webServer> section within the web.config, but i get a warning, that within the system.webServer the element "rewrite" is not allowed. How can i con...

Strange path references to Javascript files?

In a HTML page references to Javascript files are rewritten with one additional subdirectory at the end: /+sfgRmluamFuX1R5cGU9amF2YV9zY3JpcHQmRmluamFuX0xhbmc9dGV4dC9qYXZhc2NyaXB0+. Why is that and can it be a source to potential problems? In our source code we have Javascript includes like this one: On development machines and the...

Python Performance - have you ever had to rewrite in something else?

Has anyone ever had code in Python, that turned out not to perform fast enough? I mean, you were forced to choose another language because of it? We are investigating using Python for a couple of larger projects, and my feeling is that in most cases, Python is plenty fast enough for most scenarios (compared to say, Java) because it rel...

Dead languages

At which point should you (or your company) ditch the language used for many years, for which you have the workforce, simply because it became irrelevant or much better alternatives came into the marketplace? Edit:It is a tough proposition because for example, I know of companies that are stuck with PowerBuilder. They have so much inves...

How can I determine if a URL redirects in PHP?

I saw someone ask a question about detecting if a URL redirects from groovy and perl but couldn't find anything on PHP. Anyone know of somewhere I could find that code that does this? G-Man ...

How would you write this query?

I'm looking to refactor the below query to something more readable and modifiable. The first half is identical to the second, with the exception of the database queried from (table names are the same though.) SELECT Column 1 AS c1, ... Column N AS cN FROM database1.dbo.Table1 UNION SELECT 'Some String' as c1...