mod rewrite

Discussion forum for MOD Writers regarding MOD Development.
Locked
Sascha Mueller
Registered User
Posts: 95
Joined: Tue Mar 28, 2006 8:11 pm
Contact:

mod rewrite

Post by Sascha Mueller »

Hello,

I need a mod rewrite, because old gallery mod was installed, and now new gallery mod is installed. A lot of broken links are in the internet like this:

Code: Select all

http://www.mydomain.de/album_pic.php?pic_id=50
http://www.mydomain.de/album_pic.php?pic_id=300
http://www.mydomain.de/album_pic.php?pic_id=649
http://www.mydomain.de/album_pic.php?pic_id=653
New version of hyperlinks look that:

Code: Select all

http://www.mydomain.de/gallery/image.php?pic_id=50
http://www.mydomain.de/gallery/image.php?pic_id=300
http://www.mydomain.de/gallery/image.php?pic_id=649
http://www.mydomain.de/gallery/image.php?pic_id=653
I have made a file names .htaccess with mod rewrite:

Code: Select all

RewriteCond %{REQUEST_FILENAME} /album_pic.php?pic_id=(.+)
RewriteRule (.*) /gallery/image.php?pic_id=%1 [L]
But it dosn't work. Can somebody help me?

Thx a lot and nice greetings!

Sascha
Please excuse my bad English, I'm German!
User avatar
Mighty Gorgon
Registered User
Posts: 616
Joined: Thu May 23, 2002 2:56 pm
Location: Italy
Name: Luca Libralato
Contact:

Re: mod rewrite

Post by Mighty Gorgon »

Try this and let me know:

Code: Select all

RewriteRule ^.+pic_id=([0-9]*) gallery/image.php?%{QUERY_STRING}&pic_id=$1 [L]
Sascha Mueller
Registered User
Posts: 95
Joined: Tue Mar 28, 2006 8:11 pm
Contact:

Re: mod rewrite

Post by Sascha Mueller »

I've found the solution:

Code: Select all

RewriteCond %{QUERY_STRING} ^pic_id=([0-9]+)$
RewriteRule ^album_pic\.php$ /gallery/image.php?pic_id=%1 [L]
Thx for your reply!
Please excuse my bad English, I'm German!
Locked

Return to “[3.0.x] MOD Writers Discussion”