This forum has been moved here:
Helicon Tech Community Forum

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


Joined: 15 July 2011
Posts: 5
Posted: 22 July 2011 at 7:33am

Hi,
Hope you are well… My name is Raj Singla, working as a marketing Manager
for a leading Web Development & Internet Marketing company with SB Global Infosoft
we have one website for one of my client . website name is :
http://rajdhaniflorist.com/
we want to rewrite url from
http://rajdhaniflorist.com/productsDetail.asp?productCode=1539
intohttp://rajdhaniflorist.com/Designer-Flowers-Arrangement.html

we  using windows shared hosting  for this domain.  can some   resolve my issue.
Please  suggest us .

You may also be interested in two of our other services -
Yourowndir.com -   A complete Directory   website
Hostwebguru.com - The Fastest Growing Hosting Site in India
Theseowork.com � The site For  Search engine  optimization

Follow me on Face book : http://www.facebook.com/sbglobal
Follow me on  Twitter : http://twitter.com/sbglobal79
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 25 July 2011 at 7:33am

I guess it's not this only URL you want to rewrite but you are just showing the patterns, right?
If you have hundreds of similar URLs, I would suggest you to use map files.
For this one request the rules will be simply:

RewriteBase /
RewriteCond %{QUERY_STRING} ^productCode=1539$ [NC]
RewriteRule ^productsDetail\.asp$ /Designer-Flowers-Arrangement.html [NC,R=301,L]
RewriteRule ^Designer-Flowers-Arrangement\.html$ /productsDetail.asp?productCode=1539 [NC,L]

P.S. If you need the link on page to be rewritten as well, we'll go another way.

__________________
Regards,
Anton
Back to Top
 
sbglobal
Newbie


Joined: 15 July 2011
Posts: 5
Posted: 25 July 2011 at 7:43am

Dear Anton!

Greeting from SB global Infosoft!

Thanks for suggestion !

Actually I am not  asp developer . I am Asp.net developer .

So I am  unable to  understand  the code given by  You. So please  explain  step by step   about this   where we have implement  your specified code.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 26 July 2011 at 3:33am

Before I explain I want to know more details of what you really want to understand what to explain.
- Do you want a link http://rajdhaniflorist.com/productsDetail.asp?productCode=1539 to look like
http://rajdhaniflorist.com/Designer-Flowers-Arrangement.html ?

- Do you plan to have numerous links of similar pattern that need modification?

P.S. The rules must be put into the .htaccess file in the root of the target site.

__________________
Regards,
Anton
Back to Top
 
sbglobal
Newbie


Joined: 15 July 2011
Posts: 5
Posted: 26 July 2011 at 3:53am

Dear   admin !

 we   are using  database for all product . 
This is my  client website as http://rajdhaniflorist.com/

where  all product  are given .
When some one click  at any  product  then  it  will show
following  Url petren :
http://rajdhaniflorist.com/productsDetail.asp?productCode=1539
or
http://rajdhaniflorist.com/productsDetail.asp?productCode=1548

or
http://rajdhaniflorist.com/productsDetail.asp?productCode=1550

mean     deifferant is all above  url  in  quarrystring  vallue That will come according to Product Id from databse.

so  we  want  to  rewrite only that  URL  http://rajdhaniflorist.com/productsDetail.asp?productCode=1550


Either into

http://rajdhaniflorist.com/1500.html

or
http://rajdhaniflorist.com/ProductTittle.html(That will come according to querrystring  from databse)

For example :
 If orginal  url is  as
http://rajdhaniflorist.com/productsDetail.asp?productCode=1550

then should be converted  into
http://rajdhaniflorist.com/1550.html
or
http://rajdhaniflorist.com/Round-Flat-Basket-of-Flowers.html

Thanks

Can we know  Your  chat id so that we can   chat directly
i am also  Giving you my Chat Id

Gtalk : rajsingla147
Skype: Raj_singla79
yahoo: raj_singla147

Yours sincerely,
Raj Singla
Managing Director
Email:  [email protected]
Website: www.sbglobal.info
Website: www.theseowork.com :
Website: www.yourowndir.com :





Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 27 July 2011 at 2:19am

Ok, I see. So if you are satisfied with your URLs looking like http://rajdhaniflorist.com/1500.html, you may have the following rules:

RewriteBase /
RewriteCond %{QUERY_STRING} ^productCode=(\d+)$ [NC]
RewriteRule ^productsDetail\.asp$ /%1.html? [NC,R=301,L]
RewriteRule ^(\d+)\.html$ /productsDetail.asp?productCode=$1 [NC,L]

If you want corresponding titles to be taken depending on the id, you'll need the following mapfiles:

mapfile.txt
1550 Round-Flat-Basket-of-Flowers
...

revmapfile.txt
Round-Flat-Basket-of-Flowers 1550

And the config:

RewriteBase /
RewriteMap mapfile txt:mapfile.txt [NC]
RewriteMap revmapfile txt:revmapfile.txt [NC]
RewriteCond %{QUERY_STRING} ^productCode=(\d+)$ [NC]
RewriteRule ^productsDetail\.asp$ /${mapfile:%1}.html? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)\.html$ /productsDetail.asp?productCode=${revmapfile:$1} [NC,L]

__________________
Regards,
Anton
Back to Top
 
sbglobal
Newbie


Joined: 15 July 2011
Posts: 5
Posted: 27 July 2011 at 3:17am

its Ok , but please confirm me where we have to add   
followings coding

RewriteBase /
RewriteCond %{QUERY_STRING} ^productCode=(\d+)$ [NC]
RewriteRule ^productsDetail\.asp$ /%1.html? [NC,R=301,L]
RewriteRule ^(\d+)\.html$ /productsDetail.asp?
productCode=$1 [NC,L]
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 27 July 2011 at 3:37am

The code must be added into the .htaccess file in the root of your site.

__________________
Regards,
Anton
Back to Top
 

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

Printable version Printable version