Friendly url becomes ugly(FIXED)

Discuss practical ways rearrange URLs using mod_rewrite.

Friendly url becomes ugly(FIXED)

Postby hazviz » Fri Feb 24, 2006 1:14 pm

Hey all, new to the forum so I'll introduce myself.
I'm Tom, 17 from UK. :P
Sure you all feel happy now you know. :S lol

So anyways, to my problem..

I have read over all the basics in here and came up with my mod rewrite, which works! With one exception... When I go to the url, it re-directs me to the new address like it should do, but it shows this change in the browser address bar also, and I don't want it too...

here is my .htacces.

[code]Options +FollowSymLinks

RewriteEngine on
RewriteRule ^archive/([0-9]+)/([0-9]+)/([0-9]+)(|/)$ /blog/index.php?page=archive&date=$1-$2-$3 [R,L]

(Oh, i also figure thats adding (|/) at the end would allow it with or without a trailing slash. I was quite pleased when i figured that out haha)

eg. When I go to http://localhost/blog/archive/2006/12/22 it shows in the browser as http://localhost/blog/index.php?page=ar ... 2006-12-22. I just want it to stay as the nice and clean looking version.

Thanks

EDIT - FIXED
Hey all, I fixed this problem.
Incase anyone else has this too, the solution is to remove the R flag which, incidently *redirects* the page which is not what I wanted.
So, with this removed, it now works. However, you will need to make sure your links on the redirected page are absolute otherwise they wont work. Thanks
hazviz
 
Posts: 1
Joined: Fri Feb 24, 2006 12:48 pm

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 5 guests

cron