url-rewriting

Get the URL string a user entered when using .htaccess

I'm currently using an htaccess file to redirect users from detail.asp?CategoryID=XX&SubCategoryID=XX&ProductID=XX to catid-XX-subcatid-xx-productid-xx but I now need to check they've arrived at the correct page. I'm doing this by checking that the query string values are correct. However I'd rather check that the user arrived at "...

HttpModule URL rewriting using IIS6 with no extensionless URLs

We are using the Intelligencia URLRewriting module for asp.net with version 2.0 of the framework and IIS6. Our URLs typically have no extension. I understand that IIS6 cannot really deal with this situation without a blanket wildcard (which causes other problems). However, it works! Sometimes. At other times (e.g. on one dev's mac...

Looking for some URL rewriting help

Hi everyone, My question is a simple one, but I can't seem to find the answer. I'm currently working on some URL rewriting for a website, but I have encountered a problem. Currently the most basic rule I have goes something like this: RewriteRule ^([a-zA-Z]+)/(([a-zA-Z]+)/?$ index.php?mod=$1&com$2 This works in most cases, and I have...

Mod Rewrite: apply to all js and css files except ...

Hi I need to apply a minify actions to all the javascript and CSS files, except the ones I indicate. I have this condition and rule that applies to all the files (css and js): RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*\.)(js|css)$ minify.php?q=$1$2 [L,NC] I need to add the conditions to say: Apply to all except: jquery.js,...

How to get without "default.aspx" url ??

I implemented a following code in Global.asax file of my web application. void Application_BeginRequest() { string rule = ConfigurationManager.AppSettings.Get("WwwRule"); HttpContext context = HttpContext.Current; if (context.Request.HttpMethod != "GET" || context.Request.IsLocal) { return; } if (cont...

What are the performance implications of wildcard mapping all requests through IIS 6.0?

I am interested in using UrlRewriter.NET and noticed in the config page for IIS 6.0 on Win2k3, that they say to map all requests through the ASP.NET ISAPI. That's fine, but I am wondering if anyone has good or bad things to say about this performance wise? Is my web server going to be dragged down to its knees by doing this or will it ...

How to redirect www to non-www?

I am using URL re-writer module provided by http://urlrewriter.net/ site. Can anyone tell me how can I use there module to redirect www.example.com to example.com (301 redirect) Thanks ...

ASP.NET webpages without names ? ala stackoverflow?

Mentioned stackoverflow only as an example, but if you look above the URL for ask is http://stackoverflow.com/questions/ask which means /ask is a subdirectory, but they also do this for the specific question pages. How do you code this in .NET? Not a code question as much as a technique. I know this is great for SEO, but how do yo...

Can Intelligencia.UrlRewriter be made to work in IIS7?

We've inherited an application that uses the Intelligencia.UrlRewriter module. Our environment though is IIS7. We've already set our site to run in the classic asp.net application pool (which aparantly works for a lot of these kinds of problems). However we're still not seeing the URLs in our app be rewritten. Has anyone run into this? ...

mod_rewrite multiple directories to a php file

RewriteEngine on RewriteRule ^/(dir1|dir2|dir3)/(.*)$ /targetfile.php [R,L] http://www.somesite.com/dir1 -> http://www.somesite.com/targetfile.php http://www.somesite.com/dir2 -> http://www.somesite.com/targetfile.php http://www.somesite.com/dir3 -> http://www.somesite.com/targetfile.php From what I've seen online, this should work. U...

How to remove a URL's trailing slash in a Rails app? (in a SEO view)

In order to avoid content duplication, I would like to avoid the pages of my site being accessible by several URLs (with or without trailing slash). Currently, the URLs catalog/product/1 and catalog/product/1/ lead to the same page. My goal is that the second URL redirect to the first (redirection 301, of course). None page of my...

Enabling back/fwd key events for an Ajax Application

I have an application which works heavily on AJAX. However I want to have navigation functionalities in it. To spoof the url, I am changing the location.hash, to generate URL. But if i use back/fwd, only the url changes, but page wont reload. How can I override the hstory.back to reload the page. ...

Grails UrlMappings with URL-pattern ending with "/"

I have the following UrlMapping in my Grails UrlMappings class: "/$something/" { controller = "controllerName" action = "actionName" constraints { } } Requests to both "/foobar/" and "/foobar" gets routed to the correct controller and action. However, URL:s created using g:link does not end with slash ("/"...

Apache, .htaccess - Forbidding direct access to a file, but allow rewrites to go there

I've figured out how to write something like www.test.com/test to www.test.com/test.php. This is useful to give a simpler browsing experience and obscure the use of the PHP. However, I'd like to go farther and disallow access to www.test.com/test.php completely, and allow access only through www.test.com/test in order to prevent people f...

Which URL rewriting scheme is preferable? Wiki/Blog style?

I'm writing some URL rewriting software, and I want to know which URL scheme is preferable from many points of view: Blog style: my-chemistry-answer -- Why? -- (not preferable, technical) Wiki style: My_Chemistry_Answer -- Why not? -- (preferable, formal) SEO: Some say Google only splits words delimited by dashes which is why blog po...

Mod Rewrite, pass parameters from URL1 to URL2

I'm trying to rewrite the following URL test.php?par1=foo&par2=bar Into... newtest.php?hidden_par=blah&par1=foo&par2=bar I have this rule, that does not work: RewriteRule ^test.php\??(.*?)$ newtest.php?hiden_par=blah&$1 [L] Could this be done using RewriteCond or something else? (say, could this be done ?), thanks in advance. ...

IIS7 url rewrite w/ ASP.Net 3.5 SP1 + asp:Login Form does not work

Hi everyone This question was kind of touched before but not the answer I was looking for. I am using the IIS7 URL Rewrite module to rewrite my pages, and now my asp.net login form does not work!!! On my master page I have this (ASP.Net 3.5 SP1 feature)... if (!String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"]))...

Relationship between URL and Filepath in a URL-rewriting scenario..

Experience tells me I shouldn't be storing a url in my database of media items. However that is what my architect is telling me. Surely it is the job of a front end server to map the filepath to a url? Any hints? What should I be considering with regard to URL rewriting? ...

asp.net mvc on asp.net 2.0 + ajax extensions 1.0 + iis 6 on win 2k3 server

I have a lot of problems with url rewrite and ajax extensions 1.0 on a asp.net 2.0 web application. I am considering using asp.net mvc. Does it work for me since i am using asp.net 2.0, ajax extensions 1.0 + ajax control toolkit, iis 6 on a win2k3 server? My development machine is windows vista with iis 7 Please advise. Thank you. ...

which is better? asp.net 2.0 stick with isapi rewrite or upgrade to 3.5 and use mvc?

Hi all, i have a asp.net 2.0 web app that runs with ajax 1.0 extensions and isapi rewrite. I have some bugs and i am considering whether to upgrade to 3.5 and use asp.net mvc instead. Please advise. ...