Topic: PLEASE Help / Rewrite URL
|

|
| Author |
|
natureboy Newbie

Joined: 29 June 2011
Online Status: Offline Posts: 12
|
| Posted: 29 June 2011 at 12:09pm | IP Logged
|
|
|
Hello,
I have been a long time user of LinkFreeze, however my needs have become where I have to use Helicon Ape.
I am trying to write a urls like:
http://samplesite.com/public_forums/f/62/t/22116.aspx into this
http://www.samplesite.com/public-forums/GroupName/22116-subjectline.html
For the above url: 62 = GroupID (I want to call its name instead of the id)
I know there are is a similar example at: http://www.helicontech.com/articles/mod_seo/
However I can't get it to work with the above group structure. How do I call group ID?
Someone please help.
Here is a sample of what I wrote so far:
#put these rules into the /forum/.htaccess file RewriteEngine On
DBDriver mssql DBDParams "Data Source=dbServer;Initial Catalog=WebWizForum;User ID=user;Password=password" DBDPrepareSQL "SELECT Subject FROM tblTopic WHERE Topic_ID =@KEY" getSeoTopic DBDPrepareSQL "SELECT Forum_name FROM tblForum WHERE Forum_ID =@KEY" getSeoForum DBDPrepareSQL "SELECT Group_name FROM tblGroup WHERE Group_ID =@KEY" getSeoGroup
SetEnv mod_seo
RewriteMap SeoTopic dbd:getSeoTopic RewriteMap SeoForum dbd:getSeoForum RewriteMap SeoGroup dbd:getSeoGroup
RewriteMap slug int:slug
SeoRule forum_topics.asp\?FID=(\d+)(?:\&PN=(\d+))?$ \ $1(?2-$2)-${slug:${SeoForum:$1}}.html [Redirect, Scope=A] SeoRule forum_posts.asp\?TID=(\d+)(?:\&PN=(\d+)\&TPN=(\d+))?$ \ topic-$1(?2-$2-$3)-${slug:${SeoTopic:$1}}.html [Redirect,Scope=A] SeoRule forum_Group.asp\?TID=(\d+)(?:\&PN=(\d+)\&TPN=(\d+))?$ \ topic-$1(?2-$2-$3)-${slug:${SeoTopic:$1}}.html [Redirect,Scope=A]
RewriteRule ^(\d+)-(?:(\d+))?(.*).html forum_topics.asp?FID=$1(?2&PN=$2) [NC,QSA] RewriteRule ^topic-(\d+)-(?:(\d+)-(\d+)-)?(.*).html forum_posts.asp?TID=$1(?2&PN=$2&TPN=$3) [NC,QSA]
Thanks
|
| Back to Top |
|
| |
digvijay Newbie

Joined: 01 July 2011 Location: India
Online Status: Offline Posts: 1
|
| Posted: 01 July 2011 at 5:56am | IP Logged
|
|
|
Hello Friends
i have a same problem and same url. i want to Redirect Rule for this. Please reply . Anyone help me.
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 01 July 2011 at 9:09am | IP Logged
|
|
|
Hello, natureboy
What you have so far is pretty much the same we have in the article you refer to :)
What you should have is 2 mapfiles, e.g.:
mapfile.txt
62 GroupName
...
and revmapfile.txt
GroupName 62
...
And the rules like:
#http://samplesite.com/public_forums/f/62/t/22116.aspx -> http://www.samplesite.com/public-forums/GroupName/22116-subjectline.html
SeoRule public_forums/f/(\d+)/t/(\d+)\.aspx$ public-forums/${mapfile:$1}/$2-subjectline.html [Redirect, Scope=A]
RewriteRule ^public-forums/([^/]+)/(\d+)-subjectline\.html$ public_forums/f/${revmapfile:$1}/t/$2.aspx [NC,QSA]
Please clarify where should "subjectline" come from? I've put it into the rule as is just as an example.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
|
|
If you wish to post a reply to this topic you must first login
If you are not already registered you must first register
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You can vote in polls in this forum
|