url-rewriting

URL rewriting-code for rewriting

hi to all, i am working for a site,which is in php.....i want to rewrite url e.g www.3idiots.co.in/stories.php?id=17 if i want to rewrite it as www.3idiots.co.in/stories/17.html can any one tell me the code for this to write in .htaccess file.? ...

URL rewriting problem

i have made a website in php. There is a list of stories title stored in database and when user click any title among them then user is redirected to a page with a query string on it. like story.php?id=25 This means story with id 25 is now going to be displayed. Now i want to rewrite URL but when i rewrite it there occurs a problem. ...

Url Rewriting problem

Hi, Presently I am working with asp.net with c#. In my project has requirement of url rewriting functionality. I did with my local iis but when it comes to production it's not working. Is there any way of doing url rewriting with change the iis setting in production environment. ex:http://abc.com/profiles/suresh I want this type of fu...

Modify the URL without reloading the page

Is there any way I can modify the URL of the current page without reloading the page? I would like to access the portion before the # hash if possible. I only need to change the portion after the domain, so its not like I'm violating cross-domain policies. window.location.href = "www.mysite.com/page2.php"; // sadly this reloads ...

[mod-rewrite] foo.com/city/staticpage-cityname.html --> foo.com/staticpage-cityname.html

My current solution is to put everything in the site root although it gives the desired result it has crowded my root folder (more than 200 cities). I would like to put all the cities in /root/cities/ folder and rewrite so that it looks like they are in the root folder. www.foo.com/cities/citypage(.html) to www.foo.com/citypage(.html) ...

ASP.NET URL rewriting not working with folder URLs

I wrote a custom URL rewriting module, to take certain paths and map them to our catalog out of the database. I am using the technique outlined in the link at the bottom of my post. I'm using .NET 3.5. The problem is that it only works when there is a page name on the end of the original URL, but if the page name is left off, then it...

java servlets : passing url variable values with spaces

I'm building a simple java Servlet which passes categories using a URL variable into another Servlet. For example, in the following code ResultSet rs = qw.DBquery("select distinct manufacturer from Products order by manufacturer asc"); try { while (rs.next()) { table+= "<tr><td><a href=\"getItems?manufacturer=" ...

REST - supporting multiple possible identifiers

For the site I am working on, we are in the process of improving our URLs for one type of resource - specifically, moving away from numerical IDs toward unique, descriptive strings. A similar example would be switching from identifying users by numerical database ID to identifying them by username (not our specific case, but analagous). ...

Best way to format pretty URLs for numeric IDs

Alright, so let's say I'm writing a forum application, and I want pretty URLs. However, all my tables use numeric IDs, so I'm not sure the best way to format the URLs for those resources. Let's pretend I'm trying to get a topic with ID 123456 and title This is a forum post. I've seen it done a couple ways: www.example.com/topic/123456 ...

Mod Rewrite - Simple Question

This is my current .htaccess Options +FollowSymLinks DirectoryIndex index.php RewriteEngine On RewriteBase /product/ RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^(.+)\.php$ ./$1/ [R=301,L] RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L] RewriteRule ^contact/?$ ./contact.php [QSA,L] Everything i...

GoDaddy Unlimited Account Problem

When I assign multiple domains to directories in my GoDaddy hosting account management it creates a virtual directory for these domains. It also makes those domains go to that directory. For some reason, sometimes it forwards back to the full path of the hosting account. ie., I have domain abc.com in folder /_sites/abc.com/, and if I ...

Are there any gotchas for url re-writing a ColdFusion site with ISAPI_Rewrite v2?

I've been asked to help out with some ColdFusion development and one of the tasks will be to undertake url re-writing, mostly turning url parameters into a cleaner url. The site is on a hosted service with cf8 running on iis, with Helicon Tech ISAPI_Rewrite v2. Are there any things I should look out for? Thanks. ...

htaccess URL rewriting speed optimization

My server support tells me my htaccess URL rewrites are causing an overhead. I use URL rewriting for "nicer" URLs, mainly (like example.com/?foo=bar will be example.com/foo/bar or so). Generally speaking, what are some tips & tricks to keep in mind when aiming to optimize the htaccess RewriteEngine? ...

What are the best-practices and patterns for url rewriting?

How do you go about designing a url rewriting 'strategy'? I've got a clean slate as I'm helping out with an as yet un-launched site (based on url parameters) so i've no need for redirecting existing search engine results. The first one that comes to mind is rewriting common typos. What else is there to think about? ...

Migrating an existing PHP site to use URL re-writing (Pretty URL's)

I currently have a community site that I run that is made up of 15 or so php pages. It is not currently very dynamic, only using php for includes/templates. Currently no content is generated via a query string. The pages do not follow a standard naming convention and there are many inbound links. I am looking to expand the site (and st...

How do I write an .htaccess rewrite rule to convert query strings into segmented URIs?

Is there a way to put a rewrite rule in htaccess that will convert query strings to segmented URIs? For eg. http://domain.com/controller/method/?a=1&amp;b=2&amp;c=3 should get rewritten as http://domain.com/controller/method/a/1/b/2/c/3 All there is to do is remove the ? and replace the &s and the =s with a /, but I'm not quite su...

Beginner Apache URL Rewrite Question

I'm just trying to figure out if I'm on the right path - additional details on rewriting the URL in my example would be appreciated. I have installed a CMS program and would simply like that www.example.com be pointed to www.example.com/cms. I just want to know if URL rewriting through apache is the best way to accomplish this? Thank y...

nginx rewrite not working (with passenger on Mac OS X)

I have nginx with rewriting working correctly on my server in production. But when I tried to set the same rule on my local development machine (mac) the rewrite doesn't seem to be working. I want "universitytutor.local" to redirect to "www.universitytutor.local" Here is the relevant part of my nginx.conf server{ listen 80;...

URL rewrite using mod_rewrite in .htaccess

Hi, I am trying to rewrite the URL using the mod_rewrite apache module. I am trying to use it as below : Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^wants/testing.htm wants.php?wantid=$1 [L] I have created a .htaccess file in the directory from where the files are accessed. The mod_rewrite is also enabled. W...

mod_rewrite URL info required

I am new to this mod_rewrite. I have been successfully able to rewrite the URL something like this: "http://mydomain.com/products/12" to "http://mydomain.com/products.php?prodId=12" But when I give http://mydomain.com/products/12 in the address bar... the css and js files are not loaded. But when I access "http://mydomain.com/products...