<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Creating readable URLs with mod rewrite</title>
	<link>http://www.melbournechapter.net/wordpress/system-administration/apache/rich/2006/10/25/creating-readable-urls-with-mod-rewrite/</link>
	<description>web application development with popular technologies</description>
	<pubDate>Fri, 29 Aug 2008 19:07:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>

	<item>
		<title>by: Mel Drego</title>
		<link>http://www.melbournechapter.net/wordpress/system-administration/apache/rich/2006/10/25/creating-readable-urls-with-mod-rewrite/#comment-42986</link>
		<pubDate>Sun, 29 Apr 2007 12:54:38 +0000</pubDate>
		<guid>http://www.melbournechapter.net/wordpress/system-administration/apache/rich/2006/10/25/creating-readable-urls-with-mod-rewrite/#comment-42986</guid>
					<description>Hi,
I wonder if you have a solution for my problem.
I have the following setup:
NameVirtualHost 192.168.11.246

ServerName www.mysite.com
ServerAlias mysite.com
DocumentRoot /www/mysite/htdocs
Options +FollowSymLinks
User apache
RewriteEngine on
RewriteLog "/www/mysite/logs/rewrite_log"
RewriteLogLevel 9
RewriteRule ^/article-([0-9]*)-([A-Z&#124;a-z&#124;0-9&#124;-&#124;_&#124;/s]*)\.dx$ /display.do?title=$2&#38;pg=$1 [L]
RewriteRule ^/(.*\.do);jsessionid* /$1 [L]
RewriteRule ^/(.*[\.html&#124;\.jpg&#124;\.JPG&#124;\.gif&#124;\.GIF&#124;\.css]);jsessionid* /$1 [L]
RewriteRule ^(.*)/$ http://www.mysite.com/open.do [R]


(note I'm filtering out the "jsessionid"s to make search engine friendly)
(Using [PT] at end of rule)
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) init rewrite engine with requested uri /article-9-Hes_My_Hero_Hero.dx
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) applying pattern '^(.*)/article-([0-9]*)-([A-Z&#124;a-z&#124;0-9&#124;-&#124;_&#124;/s]*)\.dx$' to uri '/article-9-Hes_My_Hero_Hero.dx'
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) rewrite /article-9-Hes_My_Hero.dx -&#62; /display.do?title=Hes_My_Hero&#38;pg=9
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) split uri=/show.do?title=Hes_My_Hero&#38;pg=9 -&#62; uri=/display.do, args=title=Hes_My_Hero&#38;pg=9
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) forcing '/display.do' to get passed through to next API URI-to-filename handler
And we get a 404 as the document does not exist at
/www/mysite/htdocs/display.do

(Using [L] at end of rule)
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) init rewrite engine with requested uri /article-9-Hes_My_Hero.dx
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) applying pattern '^(.*)/article-([0-9]*)-([A-Z&#124;a-z&#124;0-9&#124;-&#124;_&#124;/s]*)\.dx$' to uri '/article-9-Hes_My_Hero.dx'
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) rewrite /article-9-Hes_My_Hero.dx -&#62; /display.do?title=Hes_My_Hero&#38;pg=9
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) split uri=/show.do?title=Hes_My_Hero&#38;pg=9 -&#62; uri=/display.do, args=title=Hes_My_Hero&#38;pg=9
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) local path result: /display.do
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) prefixed with document_root to /www/mysite/htdocs/display.do
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (1) go-ahead with /www/mysite/htdocs/display.do [OK]
(of course /www/mysite/htdocs/display.do does not exist, and I get a 404)
Why do I get those last 4 rewrites happening and how do I stop them? - that seems to be the best "solution".

(Using [R] at the end of the rule, gets a clear redirect to the original url (display.do?page=9&#38;title=Hes_My_Hero, which is what I'm trying to hide from the search engines).
Any ideas?  I'm at my wits end about this.

Thanks a lot.
Mel.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I wonder if you have a solution for my problem.<br />
I have the following setup:<br />
NameVirtualHost 192.168.11.246</p>
<p>ServerName <a href="http://www.mysite.com" rel="nofollow">www.mysite.com</a><br />
ServerAlias mysite.com<br />
DocumentRoot /www/mysite/htdocs<br />
Options +FollowSymLinks<br />
User apache<br />
RewriteEngine on<br />
RewriteLog &#8220;/www/mysite/logs/rewrite_log&#8221;<br />
RewriteLogLevel 9<br />
RewriteRule ^/article-([0-9]*)-([A-Z|a-z|0-9|-|_|/s]*)\.dx$ /display.do?title=$2&amp;pg=$1 [L]<br />
RewriteRule ^/(.*\.do);jsessionid* /$1 [L]<br />
RewriteRule ^/(.*[\.html|\.jpg|\.JPG|\.gif|\.GIF|\.css]);jsessionid* /$1 [L]<br />
RewriteRule ^(.*)/$ <a href="http://www.mysite.com/open.do" rel="nofollow">http://www.mysite.com/open.do</a> [R]</p>
<p>(note I&#8217;m filtering out the &#8220;jsessionid&#8221;s to make search engine friendly)<br />
(Using [PT] at end of rule)<br />
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) init rewrite engine with requested uri /article-9-Hes_My_Hero_Hero.dx<br />
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) applying pattern &#8216;^(.*)/article-([0-9]*)-([A-Z|a-z|0-9|-|_|/s]*)\.dx$&#8217; to uri &#8216;/article-9-Hes_My_Hero_Hero.dx&#8217;<br />
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) rewrite /article-9-Hes_My_Hero.dx -&gt; /display.do?title=Hes_My_Hero&amp;pg=9<br />
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) split uri=/show.do?title=Hes_My_Hero&amp;pg=9 -&gt; uri=/display.do, args=title=Hes_My_Hero&amp;pg=9<br />
192.168.1.26 - - [29/Apr/2007:20:53:30 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) forcing &#8216;/display.do&#8217; to get passed through to next API URI-to-filename handler<br />
And we get a 404 as the document does not exist at<br />
/www/mysite/htdocs/display.do</p>
<p>(Using [L] at end of rule)<br />
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) init rewrite engine with requested uri /article-9-Hes_My_Hero.dx<br />
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) applying pattern &#8216;^(.*)/article-([0-9]*)-([A-Z|a-z|0-9|-|_|/s]*)\.dx$&#8217; to uri &#8216;/article-9-Hes_My_Hero.dx&#8217;<br />
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) rewrite /article-9-Hes_My_Hero.dx -&gt; /display.do?title=Hes_My_Hero&amp;pg=9<br />
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (3) split uri=/show.do?title=Hes_My_Hero&amp;pg=9 -&gt; uri=/display.do, args=title=Hes_My_Hero&amp;pg=9<br />
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) local path result: /display.do<br />
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (2) prefixed with document_root to /www/mysite/htdocs/display.do<br />
192.168.1.26 - - [29/Apr/2007:20:56:40 +1000] [www.mysite.com/sid#80c9038][rid#80d1ea8/initial] (1) go-ahead with /www/mysite/htdocs/display.do [OK]<br />
(of course /www/mysite/htdocs/display.do does not exist, and I get a 404)<br />
Why do I get those last 4 rewrites happening and how do I stop them? - that seems to be the best &#8220;solution&#8221;.</p>
<p>(Using [R] at the end of the rule, gets a clear redirect to the original url (display.do?page=9&amp;title=Hes_My_Hero, which is what I&#8217;m trying to hide from the search engines).<br />
Any ideas?  I&#8217;m at my wits end about this.</p>
<p>Thanks a lot.<br />
Mel.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
