Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
How to 301 redirect pages with variables in the url?
Old 07-22-2011, 12:47 PM How to 301 redirect pages with variables in the url?
Super Talker

Posts: 113
Trades: 0
I have a bunch of pages from a forum that I want to redirect, which look like this:

Code:
Redirect 301 /forum/viewtopic.php?f=3&t=16 http://www.samewebsite.com/newurl
I tried putting that (and about 15 more lines) in a .htaccess file, but none of the redirects work.

From the reading I've been doing, I think the problem might be the fact that the pages (forum threads) are specified by the variables in the URL. Is that the problem? What should I do?

Thanks!
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2011, 01:04 PM Re: How to 301 redirect pages with variables in the url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And do you want them all to go to the same URL?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2011, 01:27 PM Re: How to 301 redirect pages with variables in the url?
Super Talker

Posts: 113
Trades: 0
No, unfortunately they go to different URLs.
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
Old 07-22-2011, 01:30 PM Re: How to 301 redirect pages with variables in the url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and the patterns to match for the target pages?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2011, 01:34 PM Re: How to 301 redirect pages with variables in the url?
Super Talker

Posts: 113
Trades: 0
I'm sorry, I'm really illiterate when it comes to this server admin stuff. What do you mean by patterns to match?

There are no variables in the new URLs, if that's what you're asking. The new pages are scattered throughout different directories and have no similarities.

ex.

Code:
Redirect 301 /forum/viewtopic.php?f=3&t=16 http://www.samewebsite.com/a/new/dir/page1
Redirect 301 /forum/viewtopic.php?f=5&t=2 http://www.samewebsite.com/another/dir/filename
Redirect 301 /forum/viewtopic.php?f=1&t=99 http://www.samewebsite.com/yet/another/one

Last edited by Learnin' n00b; 07-22-2011 at 01:35 PM..
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
Old 07-22-2011, 01:39 PM Re: How to 301 redirect pages with variables in the url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
See this thread (post #6 onwards), a "smart 404" might be more in order.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2011, 01:40 PM Re: How to 301 redirect pages with variables in the url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Assuming that viewtopic no longer exists.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-22-2011, 01:49 PM Re: How to 301 redirect pages with variables in the url?
Super Talker

Posts: 113
Trades: 0
Yes, the viewtopic page no longer exists..

Skimming the thread you linked to, are you saying that the easiest solution would be to create a custom 404 page which checks the URL and, if it's one that needs to be redirected, redirect the page?
Learnin' n00b is offline
Reply With Quote
View Public Profile
 
Old 07-24-2011, 10:20 AM Re: How to 301 redirect pages with variables in the url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It works for me on modtalk.co.uk.

It's also a more "server friendly" solution than several lines of htaccess directives that have to be checked on every request.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How to 301 redirect pages with variables in the url?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29408 seconds with 12 queries