Bluehost.com Web Hosting $6.95

Need help with rewrite rule

This is a discussion on Need help with rewrite rule within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello all ! I could use some help setting up a rewrite rule. This is what I want to do : the ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-28-2007
Lupus
 
Posts: n/a
Default Need help with rewrite rule

Hello all !

I could use some help setting up a rewrite rule.
This is what I want to do :
the URL http://www.domain.com/2007-001 should lead to www.domain.com/
somepage.php?id=2007-001
This is what I have :

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([^/]+)/?$ /somepage.php?id=$1 [QSA] [nc]
</IfModule>

This works if I'm working with a subdir (ie. http://www.domain.com/
subdir/2007-001) where the rewriterule is set inside the subdir and
the .php-file is placed in the root.

I'd like to remove the subdir, but it doesn't work. Somehow I must add
a condition stating that somepage.php must not be redirected, but I
honestly don't know how to do this... Can anyone help me ?


Regards,
Mathew

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:43 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0