Hello, need some quick help :)

New to mod_rewrite? This is a good place to start.

Hello, need some quick help :)

Postby quickline » Sat Aug 07, 2004 11:33 pm

I need mod_rewrite to do a bit of rewriting for me. I need 2 variations:

http://site.com/index.php?section=pics&set=01
to...
http://site.com/pics/set/01

AND..

http://site.com/~iquest
to...
http://site.com/users/iquest

___________________________________________

I have this (for the first variation):

Code: Select all
RewriteEngine on
RewriteRule ^([A-Za-z]+)/set/([0-9]+)/$ index.php?section=$1&set=$2
RewriteRule ^([A-Za-z]+)/set/([0-9]+)$ section/$1/set/$2
RewriteRule ^([A-Za-z]+)/$ index.php?section=$1
RewriteRule ^([A-Za-z]+)$ index.php?section=$1


BUT THE IMAGES DONT SHOW! How can I make a successful rewrite and still be able to show the images from other directories without typing the full url?

Thanks a lot.
quickline
 

Postby quickline » Sun Aug 08, 2004 1:44 am

Here's an update of my code. Please do correct/fix/add. I'm a n00b.

Code: Select all
Options +FollowSymlinks
RewriteEngine on
RewriteBase /ht
RewriteRule ^([A-Za-z]+)/$ index.php?sect=$1
RewriteRule ^([A-Za-z]+)$ index.php?sect=$1
RewriteRule ^([A-Za-z]+)/([A-Za-z]+)/$ index.php?sect=$1/$2
RewriteRule ^([A-Za-z]+)/([A-Za-z]+)$ index.php?sect=$1/$2
quickline
 

Postby quickline » Mon Aug 09, 2004 1:20 pm

Anyone? Please?
quickline
 

Postby seomike » Tue Aug 10, 2004 6:45 am

I've always just implemented the absolute url when I do my mods. sorry can't help ya there.
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas


Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 19 guests

cron