Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > ModRewrite

ModRewrite
Thread Tools
Junior Member
Join Date: May 2003
Status: Offline
Reply With Quote
May 9, 2004, 06:04 PM
 
Hey guys/gals,

I'm using modrewrite for my website, and the coding is as follows. Does anyone know how to re-write it so that it will accept a trailing slash?

RewriteRule ^fakedir/(.*) realdir/index.php?id=$1

Thanks!
Jon Marus
www.jmarus.com - kicks by JM
     
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
May 9, 2004, 07:56 PM
 
Hey I recently redid our site with modrewrite URLs and had your same question.

None of the urls to be rewritten were real directories, so if yours is the same, you can do what I did and exclude all real directories from the rewrite and then remove any trailing slashes (put this before your rewrite rules begin):

Code:
# Do not rewrite real directories RewriteCond %{REQUEST_FILENAME} !-d # Remove trailing slashes RewriteRule ^(.*)/$ /$1
Not sure of your exact situation or if this will work for you, but I hope it helps.
     
RGB
Mac Elite
Join Date: Jan 2002
Location: College in the Land of Oz
Status: Offline
Reply With Quote
May 11, 2004, 04:36 AM
 
I've only glanced at the mind-boggling ModRewrite documentation briefly.

Let's say I had a link,

http://www.domain.com/?section=01&di...amp;answer=010

What would I have to do to make that load the file,

http://www.domain.com/01/04/010.php ?
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 11, 2004, 05:28 AM
 
Originally posted by RGB:
I've only glanced at the mind-boggling ModRewrite documentation briefly.

Let's say I had a link,

http://www.domain.com/?section=01&di...amp;answer=010

What would I have to do to make that load the file,

http://www.domain.com/01/04/010.php ?
you could always try the mod_rewrite RewriteRule Generator, or get your hands dirty with this page (local link, but should work on your mac)
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:30 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2