Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-10-2009, 06:21 PM   #1
LQ Newbie
Registered: Nov 2005
Posts: 18

Rep: Reputation: 0

Hello I am using mod_rewrite for making my urls user friendier. I have the following issue :

original url :
wanted url :

1. RewriteRule ^team/([^/\.]+)/?$ /history.php?team=$1 [QSA,L,NC]

the above statement works fine but i want to replace the spaces of a folder with hiphens so to a url like the one below I won't have any issues with the browser:

original url : celtics
wanted url :

any help ?

Thank you,
Old 01-12-2009, 11:16 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,293

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335

This is not tested, but I think it might work:

RewriteRule ^team/([^/\.-]+)-([^/\.-]+)/?$ /history.php?team=$1+$2 [QSA,L,NC]

I don't understand the last /? characters, but if it worked, I guess you should leave it as it is.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_rewrite basarab1310 Linux - Newbie 1 11-06-2008 07:57 AM
Help with mod_rewrite MicahCarrick Linux - Software 3 05-23-2007 08:09 PM
mod_rewrite mr_dizzle Linux - General 1 02-02-2006 07:32 PM
Apache and mod_rewrite notsoevil Linux - General 0 01-23-2002 01:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration