<?xml version="1.0"  encoding="utf-8"?>
	<feed xmlns="http://www.w3.org/2005/Atom">
		<title>Comments to Video Tutorial: Eliminating Dynamic URLs with Mod_Rewrite</title>
		<link href="http://www.practicalecommerce.com/atom/article/394/" rel="self"/>
  	<updated>2007-11-03T08:39:58-07:00</updated>
		<author>
  	  <name>Practical Ecommerce</name>
			<email>info@practicalecommerce.com</email>
  	</author>
  	<id>http://www.practicalecommerce.com/</id>
		<rights>Copyright 2007 Confluence Publishing DBA Practical Ecommerce</rights>
		<entry>
			<title>Gab</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment4014" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment4014</id>
			<updated>2007-11-03T08:39:58-07:00</updated>
			<summary>Wow, nice tutorial. 

Thank you so much for this. It really helps, specially for SEO and nice pretty URLs. Thanks!</summary>
			</entry>
			
				<entry>
			<title>juan</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3838" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3838</id>
			<updated>2007-10-09T17:48:32-07:00</updated>
			<summary>Oh man...nice tutorial... and all that works, but how can i make to actually work with a real website?

do i have to replace index.php
for something else?

what i mean i&#039;m only getting the:

out variables

#####

The following variables were passed in the URL string:

Variable 1: $1
Variable 2: $2
Variable 3: $3
Variable 4: $3

Your mod-rewrite script seems to be working fine.

####

what is the step to make work 

i tried all this rules in my .htaccess

#RewriteRule ^ppc/(.*)/ index.php?var1=$1&amp;var2=$2&amp;var3=$3

#RewriteRule ^ppc/(.*)/ index.php?ppc=$1

RewriteRule ^abc/([^/\.]+)/?$ index.php?var1=$1&amp;var2=$2&amp;var3=$3 [L]

###

http://www.example.com/abc/index.php?var1=$1&amp;var2=$2&amp;var3=$3

it suppose to go to www.example.com/ppc/var/1/var2/var3 and so on

why is not working?


please some one help.

can some one help

thanks.</summary>
			</entry>
			
				<entry>
			<title>netmastan</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3785" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3785</id>
			<updated>2007-10-03T00:10:18-07:00</updated>
			<summary>Brian&#039;s solution won&#039;t work as he suggested to change images src to &#039;images/mymage&#039; to /images/myimage&#039; . 

For example, if my site is http://localhost/mysite and I change image src to &quot;/images/myimage&quot;, then image src would be http://localhost/myimage instead of http://localhost/images/myimage. This also applies to style sheet,javascript.

Is there any other solution through .htacces?

</summary>
			</entry>
			
				<entry>
			<title>Julia</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3578" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3578</id>
			<updated>2007-09-05T10:54:57-07:00</updated>
			<summary>We have this code working fine on a solaris server, but when we moved our site to a Linux server the redirecting doesn&#039;t work.  Any ideas?  Thanks</summary>
			</entry>
			
				<entry>
			<title>Brian Getting</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3503" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3503</id>
			<updated>2007-08-24T14:12:55-07:00</updated>
			<summary>John- If your URL is something along the lines of:

/mysite/john_smith

You will want to have the value of &quot;john_smith&quot; passed as a variable ($1) to the script that is accessing that information.  The script should then go through and automatically replace the &quot;_&quot; with a space (&quot; &quot;) using something like .gsub (for Ruby).  Then the database is queried for the user&#039;s name.  In most cases, as I imagine it, you will have a first name and last name column in the database, so you would actually want to split the name at the underscore, and query the database for the user with that first and last name combination.

Hope this helps some.</summary>
			</entry>
			
				<entry>
			<title>Brian Getting</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3502" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3502</id>
			<updated>2007-08-24T14:08:27-07:00</updated>
			<summary>Josh- You could try the BASE HREF meta tag in your pages, but I would recommend going with images links such as &quot;/images/your_image.jpg&quot; rather than &quot;images/your_images.jpg&quot;.

This has many advantages, and is probably the best way to do things.</summary>
			</entry>
			
				<entry>
			<title>john</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3501" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment3501</id>
			<updated>2007-08-24T13:29:33-07:00</updated>
			<summary>How do you include chars like _ - etc. ? 
I want someone mentioned in the thread before I want to create mysite.com/john..
however the only way i can use (.*) is if i have a directory /users/ .... but then people have to type /users/john to access johns profile... i want them to just have to write mysite/john 
it works without the users directory if i use (a-z) etc... but then if the users name has an underscore or any other chars it won work...
 how is this done so that you can also include _ - in the users name. thanks J</summary>
			</entry>
			
				<entry>
			<title>josh</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment2957" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment2957</id>
			<updated>2007-06-04T00:33:19-07:00</updated>
			<summary>this did present one problem for me. I use local values for displaying links and images in my html code.  Having my urls as such:

http://www.mysite.com/view/1234 

is telling the site to look for images in view/1234/images instead of /images.

Is there a simple solution for this that wont require changed the src to each image and link on my site?</summary>
			</entry>
			
				<entry>
			<title>Josh</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment2955" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment2955</id>
			<updated>2007-06-04T00:06:26-07:00</updated>
			<summary>I&#039;ve been wondering about how to do this for years, but never tried. Didn&#039;t realize how easy it could be.  Great benefit to my site, thanks.

- Josh</summary>
			</entry>
			
				<entry>
			<title>Brian Getting</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment704" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment704</id>
			<updated>2007-03-07T19:19:04-07:00</updated>
			<summary>Filip,

You need to put it out at least one directory, otherwise it runs through a loop where any address at your site (since they all pass the RewriteRule test) generates a call back to the index page, passing everything after your domain name along as a variable.  That&#039;s why you get the output that you are getting.

Try doing something like this, which should work:

RewriteRule ^users/(.*) index.php?user=$1
</summary>
			</entry>
			
				<entry>
			<title>Filip Pavlis</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment272" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment272</id>
			<updated>2007-02-09T13:36:36-07:00</updated>
			<summary>Hello, perfect tutorial, but I have one question, if I try www.something.com/john to rewrite on www.something.com/index.php?user=john it doesn&#039;t work. I tried anything, for example RewriteRule ^(.*)$ index.php?user=$1 [nc] but it returns index.php, but i need to return john. I tryed the direct url RewriteRule ^http://www.something.com/(.*)$ index.php?user=$1 [nc] but it still doesnt work. The address with www.something.com/john/ working, because I put this (.*) /  to rewrite script. Please somebody to help me with the line code.</summary>
			</entry>
			
				<entry>
			<title>Brian Getting</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment257" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment257</id>
			<updated>2007-02-06T10:04:26-07:00</updated>
			<summary>In this particular tutorial, I am using Dreamweaver as a text editor.  You could use any plain text editor, but I like to use some sort of IDE that has code highlighting and auto-indent.  Another good choice (if you are on a mac) is an application called TextMate, which is also a great code editing tool.</summary>
			</entry>
			
				<entry>
			<title>Brandon Eley</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment251" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment251</id>
			<updated>2007-02-06T07:22:00-07:00</updated>
			<summary>I was wondering, is that Dreamweaver you&#039;re using or some other HTML editor? Nice tutorial... I think people are scared of mod_rewrite but it&#039;s really not difficult and can make a huge difference in usability and search engine optimization.</summary>
			</entry>
			
				<entry>
			<title>Manisekaran</title>
			<link href="http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment200" rel="alternate"/>
			<id>http://www.practicalecommerce.com/articles/394/Video-Tutorial-Eliminating-Dynamic-URLs-with-ModRewrite/#comment200</id>
			<updated>2007-01-25T07:40:50-07:00</updated>
			<summary>Great</summary>
			</entry>
			
				
	</feed>