•
•
•
•
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
![]() |
•
•
Join Date: Nov 2004
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
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!
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!
First, configure your servers and virtual servers with mod_rewrite by adding this to apache (I'm assuming you're using apache):
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.
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Linux Servers and Apache Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
apple bbc cd cellphone choose code computer core debian dell desktop development drivers enterprise fedora fiji games gentoo gpl hardware ibm infrastructure install kernel laptop linux marketing microsoft mobile news novell open open source openoffice operating os palm preinstall red hat rhel security server source sun system ubuntu unix vista web windows
- Regular Expressions (VB.NET)
- Parsing a log file using regular expressions (C#)
- .php vs. .html (Search Engine Optimization)
- Regular Expressions (Computer Science and Software Design)
- multiple variables in a mod_rewrite URL string (Linux Servers and Apache)
- Regular Expressions (C#)
- matching regular expressions (Java)
Other Threads in the Linux Servers and Apache Forum
- Previous Thread: security problem
- Next Thread: Redirecting images depending on the page they are displayed on.


Linear Mode