Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
Featured Web Site Template

Hundreds More at Free Site Templates.com!

Web Site Partners
Sponsored Links
Jet City Software
 
Whos Here ?
There are 0 guests and 2 members in the forums right now.
Reflects user activity within the last 5 minutes
Moderator(s): Prowler, jcokos
Member Message

the_west_wing
Joined: Aug 20, 2008
# Posts: 21

View the profile for the_west_wing Send the_west_wing a private message

Posted: 2008-Oct-08 09:11
Edit Message Delete Message Reply to this message

Hi Everyone,

I have a question from a friend of mine (yeah a real one not me pretending !!!). If anyone can help please, and I hope the text below makes sense to you guys as it is over my head...

I am looking at writing a Classic ASP script which uses Request.ServerVariables to parse SEO friendly URLs and redirect the user to the relevant pages in the website (e.g. default.asp?PID=30) and was wondering where best to use the script either as a 300 or 400 error message. The parsed querystring data would do a lookup in the database and then generate the relevant URL.

Many thanks to you all in advance and I hope to hear from someone soon please.

Thank you.



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Oct-08 10:06
Edit Message Delete Message Reply to this message

The script must return "200 OK" in the header, and then follow that up with the page code and content in the same HTTP transaction.

There is no redirect involved here at all when directly serving the content.

If you were to redirect from folder-based URLs to dynamic-with-parameters URLs then it is the dynamic-with-parameters URLs that would be indexed.


By the way, URLs that redirect aren't indexed. I don't think you have understood the process of what happens in the server.

There is one redirect that you do need to have - and that is one that should someone ask for a URL with parameters, they will be redirected (301 redirect) to the URL that looks like folders. This redirect stops the parameter-based URLs from being indexed as Duplicate Content.



the_west_wing
Joined: Aug 20, 2008
# Posts: 21

View the profile for the_west_wing Send the_west_wing a private message

Posted: 2008-Oct-08 11:20
Edit Message Delete Message Reply to this message

Thanks for the help and information g1smd.

In your last paragraph you mentioned that the 301 redirect will take a url containing parameters and redirect to a folder based url. I need this to work the other way around please.

Many thanks for your help and guidance so far, much appreciated.




g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Oct-08 12:15
Edit Message Delete Message Reply to this message

Are you sure?


Normally you would have:


1. A 301 redirect from dynamic (parameters in any order) to fixed-format folders.

So, all of these URL requests arriving at the server:

example.com/?cat=345&art=1234567
example.com/?art=1234567&cat=345
example.com/index.php?cat=345&art=1234567
example.com/index.php?art=1234567&cat=345
www.example.com/?cat=345&art=1234567
www.example.com/?art=1234567&cat=345
www.example.com/index.php?cat=345&art=1234567
www.example.com/index.php?art=1234567&cat=345

would be redirected (301) to this URL:

www.example.com/345/1234567



2. A rewrite to connect the URL request:

www.example.com/345/1234567

to the internal folder and filepath on the server:

/index.php?cat=345&art=1234567

in order to serve the content.



The on-page links within your site would point to these types of URLs:

/345/1234567

and those are the URLs that would be indexed.



the_west_wing
Joined: Aug 20, 2008
# Posts: 21

View the profile for the_west_wing Send the_west_wing a private message

Posted: 2008-Oct-08 13:37
Edit Message Delete Message Reply to this message

Thanks for that response but what I need to do is pass the following:

[link]

This will redirect (in the best way possible) to:

[link]

I can write an ASP Script to do this but need to know if a 300/400 error page can do this in a SEO friendly manor.

Cheers g1smd



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Oct-08 19:04
Edit Message Delete Message Reply to this message

Which URL is in the link they click on to get there?

Which URL should they see in their browser once they are on the page?

If they type a URL in to get there, which one is it?



I assume that the real file is physically located at /default.asp on the server.



the_west_wing
Joined: Aug 20, 2008
# Posts: 21

View the profile for the_west_wing Send the_west_wing a private message

Posted: 2008-Oct-09 13:47
Edit Message Delete Message Reply to this message

I want them to type in/link from in

domain.com/order/

And it will take them to:

domain.com/default.asp?PID=8

Thanks.



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Oct-09 14:10
Edit Message Delete Message Reply to this message


You only answered two of the questions. What is the answer to this one below?


Which URL should they see in their browser once they are on the content page?





the_west_wing
Joined: Aug 20, 2008
# Posts: 21

View the profile for the_west_wing Send the_west_wing a private message

Posted: 2008-Oct-09 15:02
Edit Message Delete Message Reply to this message

Sorry,

Not reeally bothered, but ideally domain.com/order

Thanks.



g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418

View the profile for g1smd Send g1smd a private message

Posted: 2008-Oct-09 15:05
Edit Message Delete Message Reply to this message

If that is the case, then the redirect and rewrite method I listed above (numbered items) is exactly what you need.... except your code will be a lot more simple as you only have one parameter in the URL.



the_west_wing
Joined: Aug 20, 2008
# Posts: 21

View the profile for the_west_wing Send the_west_wing a private message

Posted: 2008-Oct-09 15:37
Edit Message Delete Message Reply to this message

Thanks g1smd,

My mate has been replying to you (easier than me trying to explain it smile)

He will give that a go and see what happens, so thanks for the information.

I will (or he will) let you know how things go with it and what happens.

Thanks again.


You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
  1. You have not yet logged in, or registered properly as a member
  2. You are a member, but no longer have posting rights.
  3. This is a private forum, for which you do not have permissions.

If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

If you cannot find this message, click here to Re-Send it.

If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

New posts Forum is locked
© 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions