User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Linux Servers and Apache section within the Tech Talk category of DaniWeb, a massive community of 426,592 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,681 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Linux Servers and Apache advertiser: Programming Forums
Views: 3261 | Replies: 2
Reply
Join Date: Nov 2004
Posts: 2
Reputation: apparition668 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
apparition668 apparition668 is offline Offline
Newbie Poster

mod_rewrite: help with regular expressions

  #1  
Nov 9th, 2004
Good Afternoon:

I am looking to use Apache's mod_rewrite module to rearrange some URLs, but my knoweldge of regular expressions is SORELY lacking.

I would like to take a url such as:

http://www.somesite.com/folder/somepage.html

and translate it to:

http://www.somesite.com/index.php?de...=somepage.html

and, just as likely:

http://www.somesite.com/folder/anoth.../somepage.html

to:

http://www.somesite.com/index.php?de.../somepage.html

Would someone please assist me with this? I would greatly appreciate it!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2004
Location: VA, USA
Posts: 459
Reputation: TKS will become famous soon enough TKS will become famous soon enough 
Rep Power: 6
Solved Threads: 17
TKS's Avatar
TKS TKS is offline Offline
Posting Pro in Training

Re: mod_rewrite: help with regular expressions

  #2  
Nov 10th, 2004
First, configure your servers and virtual servers with mod_rewrite by adding this to apache (I'm assuming you're using apache):

RewriteEngine on
RewriteLog /path/to/logs/server.rewrite.txt
RewriteLogLevel 1

Next, find out which scheme you would like to use for rewrite depending on your comfort zone with apache directives...

http://httpd.apache.org/docs/misc/rewriteguide.html

That should get you where you need to go.
My Home Away from Home: Yet Another Linux Blog
Reply With Quote  
Join Date: Nov 2004
Posts: 2
Reputation: apparition668 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
apparition668 apparition668 is offline Offline
Newbie Poster

Re: mod_rewrite: help with regular expressions

  #3  
Nov 10th, 2004
I had gotten that far, but am specifically confused with how to write the regular expresssions to do the URL replacement.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Linux Servers and Apache Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Linux Servers and Apache Forum

All times are GMT -4. The time now is 10:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC