This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: How To Rewrite This Url
Author
Message |
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 14 July 2011 at 10:10am

Hello,

I am having trouble rewriting the following dynamic url:

http://test.com/74-group_name.html?PageIndex=9&forumoptions=::11::&ThreadSortBy=LastPost&SortOrder=Ascending

to:

http://test.com/forums/74-group_name.html?PageIndex=9&forumoptions=::11::&ThreadSortBy=LastPost&SortOrder=Ascending


Thanks
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 14 July 2011 at 10:31am

Hello.
Please share your configuration code. I’ll try to guide you.
You may also purchase premium support which includes configuration code design: http://www.helicontech.com/order/#support

Thank you.

__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 14 July 2011 at 10:56am

Configuration code?

I just want to rewrite the above url.

http://test.com/74-group_name.html?PageIndex=9&forumoptions=::11::&ThreadSortBy=LastPost&SortOrder=Ascending

to:

http://test.com/forums/74-group_name.html?PageIndex=9&forumoptions=::11::&ThreadSortBy=LastPost&SortOrder=Ascending

I want if any url has the query string ?pageindex=9&foumoptions=::11 to put the tag forums before the group name.

Thanks


Back to Top
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 14 July 2011 at 11:40am

This is what I wrote and tried but didnt work:


RewriteCond %{QUERY_STRING} ^pageindex=$&forumoptions=::$
SeoRule $1/$2-${slug:${SeoForum:$2}}.html$3    $1/forums/$2-${slug:${SeoForum:$2}}.html$3   [Redirect,Scope=A]
RewriteRule 1/forums/$2-${slug:${SeoForum:$2}}.html$3 http\://test.com/$2-${slug:${SeoForum:$2}}.html$3  [NC,QSA]




Back to Top
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 15 July 2011 at 11:11am

Hello,

I know how to write them individually. However the data comes from the db.

Is there one rule that will fix all of them?

RewriteCond %{QUERY_STRING} ^PageIndex=(.*)$ 
RewriteRule ^81-group-name.html$  http://test.com/forums/81-group-name.html? [NC,R=301,L]

Someone, please help me with this.  

Thanks
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 15 July 2011 at 1:06pm

Hello.
Please try the following example:
Code:
RewriteCond %{QUERY_STRING} pageindex=9&foumoptions=::11 [NC]
RewriteRule (.*) /forums/$1 [R=301,L]


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 15 July 2011 at 1:24pm

Hello,

I tried the rule and i get this error:

http://test.com/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/forums/63-group-name.html?showforum=9&ThreadSortBy=Subject&SortOrder=Ascending&PageIndex=1&forumoptions=::11::

The page isn't redirecting properly

Why does it put that many forums in it?


Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 18 July 2011 at 8:19am

Hello.
Please try this one:
Code:
RewriteCond %{QUERY_STRING} pageindex=9&foumoptions=::11 [NC]
RewriteCond %{REQUEST_URI} !^/forums.*$ [NC]
RewriteRule (.*) /forums/$1 [R=301,L]


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 19 July 2011 at 1:28pm

This works well, however it wrecks another section, where it has that query. Is there a way to exclude this url:

http://test.com/f/topicsnotread.aspx?PageIndex=1&forumoptions=::11

Thanks for all the help.
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 19 July 2011 at 1:32pm

Hi,
Try to add the following condition:
Code:
RewriteCond %{REQUEST_URI} !^/f/.*$ [NC]


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 19 July 2011 at 2:13pm

You are awesome man. I will purchase the full version.


Back to Top
 
sbglobal
Newbie


Joined: 15 July 2011
Posts: 5
Posted: 22 July 2011 at 9:36pm

we want to rewrite url from
http://rajdhaniflorist.com/productsDetail.asp?
productCode=1539
intohttp://rajdhaniflorist.com/Designer-Flowers-
Arrangement.html
Back to Top
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 28 July 2011 at 12:11pm

Hello,

Now my ajax postback requests are not working.

Commands like this:
javascript:__doPostBack('ctl00$ctl00$content$content$ctl00$w_2435$_3fb51d5$ctl00$ctl00$ctl00$ConditionalContent2$ctl07$SetCookieValueForm4$ctl04$UnAnsweredOnly','')

Are not working. I use lots of ajax on my site, so I can't go in there and edit every request.

Is there a rule I can use to block Ajax postbacks from firing?

This is my rule:

SeoRule ^?(.*)/f/(\d+)\.aspx(.*)$   $1/forums/$2-${slug:${SeoForum:$2}}.html$3   [Redirect,Scope=A]
RewriteRule ^?(.*)/(\d+)-(.*)\.html(.*)$ http\://test.com/f/$2.aspx$4  [NC,QSA]


Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 29 July 2011 at 7:03am

Hello.
Please provide examples of non-working requests. The javascript sample code doesn’t provide such information.
Thank you.

__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 02 August 2011 at 1:27pm

Hello,

I having similar issues to this post:

http://www.helicontech.com/forum/12930-problem_with_ajax.html

Very similar to this example:

<a href="javascript:__doPostBack('rptFriendNotes$ctl00$butComment','')" id="rptFriendNotes_ctl00_butComment">Leave a comment</a>

How can I make the above rule work with ajax?  There are lots of requests, so I can't go in there and make it work by changing the code.

Thanks

 

Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 03 August 2011 at 8:32am

Hello.
The solution is to exclude post-back request from the rules.
Please find out what request goes to the server when you click on “Leave a comment” link.

__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
natureboy
Newbie


Joined: 29 June 2011
Posts: 12
Posted: 10 August 2011 at 10:02am

Hello,

This is the request that gets sent:

<input id="ctl00_ctl00_content_content_ctl00_w_3051_ctl01_ctl00_forumSubscriptions_ctl02_ctl03_ctl18_ctl09" type="hidden" value="0" name="ctl00$ctl00$content$content$ctl00$w_3051$ctl01$ctl00$forumSubscriptions$ctl02$ctl03$ctl18$ctl09">


So how do I exclude this?

Thanks
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 13 August 2011 at 5:32pm

Hello.
That’s HTML code. When you click on the link, an HTTP request is sent to the server. The goal is to exclude this request. For example, if the click fires /foo/bar.aspx request, then you should exclude it as follows:
Code:
RewriteCond %{REQUEST_URI} !/foo/bar\.aspx [NC]
# RewriteRule goes here


Additionally please try the following general rule:
Code:
RewriteRule ^(.+\.axd.*)$ - [NC,L]

It must be put above other rules.

__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version