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.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
redirect contents of directory
Old 01-15-2009, 08:29 AM redirect contents of directory
magicvw's Avatar
Extreme Talker

Latest Blog Post:
Ye Olde Christmas Music
Posts: 235
Name: Vicky
Location: Brit in Bulgaria
Trades: 1
On an older version of my site I had a directory folder which no longer exists. Ages ago, someone (not me) linked to a page in that directory on a forum and I am now getting some hits from it, which are obviously going to my 404 page. I also get some hits to the ex-pages which I guess are people's saved bookmarks which are now out of date.

The 404 page is customized with a search box to help them get to where they want, but the situation is pants: I want to get them straight to the right page, which still exists but with a different name and in a different directory.

What's the most efficient way to solve this? I have thought about reconstructing the folder and the pages and doing reload to redirect them, but this could potentially amount to quite a lot of pages.

Is there any way to redirect any request of a page from a certain folder, whatever its name? I.e., when someone types
/oldfolder/anyoldname.html
they get redirected to
/newfolder/index.html and can find the page they need

rather than 404? I only have 2 folders that are defunct but lots of files in them, so this would be quicker than resurrecting all the old filenames, but is it possible?
__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
 
Register now for full access!
Old 01-15-2009, 09:04 AM Re: redirect contents of directory
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
.htaccess and RewriteRule are the answers.
http://www.askapache.com/htaccess/mo...nd-tricks.html
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 09:12 AM Re: redirect contents of directory
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
.htaccess is not my strong point (Windows IIS is my forte )

But
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.tld$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.tld$
RewriteRule ^oldfolder/?(.*)$ "http\:\/\/www\.domain\.tld\/newfolder\/" [R=301,L]
should wildcard redirect any page from oldfolder to /newfolder/
__________________
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 offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to redirect contents of directory
 

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 1.56541 seconds with 12 queries