HighDots Forums  

Redirecting to the New Location of a File.

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Redirecting to the New Location of a File. in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
***Jake***
 
Posts: n/a

Default Redirecting to the New Location of a File. - 03-25-2009 , 10:56 AM






I have a couple of files?mostly MP3s?that I need to move to a different
directory. How do I redirect users to the files' new location. The standard
redirect code is fine for HTML pages that have moved, but I don't know how to
adapt it for files. Thanks.

<meta http-equiv="Refresh" content="5;
url=http://www.quackit.com/html/tags.cfm">


Reply With Quote
  #2  
Old   
***Jake***
 
Posts: n/a

Default Re: Redirecting to the New Location of a File. - 03-25-2009 , 11:15 AM






Just to make it clear, I need to automatically redirect from

www.domain.com/directory/file.mp3

to

www.domain.com/newdirectory/file.mp3


Reply With Quote
  #3  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Redirecting to the New Location of a File. - 03-25-2009 , 12:35 PM



You would use ISAPIRewrite/ModRewrite on Windows servers or .htaccess on
*nix servers to do this redirection. Talk to your host about this.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"***Jake***" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
I have a couple of files?mostly MP3s?that I need to move to a different
directory. How do I redirect users to the files' new location. The
standard
redirect code is fine for HTML pages that have moved, but I don't know how
to
adapt it for files. Thanks.

meta http-equiv="Refresh" content="5;
url=http://www.quackit.com/html/tags.cfm"



Reply With Quote
  #4  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Redirecting to the New Location of a File. - 03-25-2009 , 02:16 PM



..oO(***Jake***)

Quote:
I have a couple of files?mostly MP3s?that I need to move to a different
directory. How do I redirect users to the files' new location. The standard
redirect code is fine for HTML pages that have moved
A meta-"redirect" is never fine, because it has many severe drawbacks.
The one and only correct way to do such things is on the HTTP level by
sending an appropriate status code (e.g. 301 for "Moved Permanently")
back to the client. On Apache servers redirects like

example.com/directory/file.mp3 -> example.com/newdirectory/file.mp3

can easily be achieved with a single directive in an .htaccess file,
which is stored in the site's root directory. Something like

RedirectPermanent /directory http://example.com/newdirectory

will then redirect all requests for the old directory to the new URL.
Can't get easier. If you're on a Windows box with IIS or not allowed to
use .htaccess files, your might have to ask your host.

Micha


Reply With Quote
  #5  
Old   
***Jake***
 
Posts: n/a

Default Re: Redirecting to the New Location of a File. - 03-27-2009 , 09:52 AM



This is a little embarrassing since you said, "Can't get easier," but (*cough*
*cough*) how do I create a .htaccess file? In any text editor? (I'm on a Mac.)
What do I name the .htaccess file? I use Dreamhost as my service provider. Do I
need to place the file at the root address of my domain or at the root level of
the shared server? Thanks for the help.


Reply With Quote
  #6  
Old   
***Jake***
 
Posts: n/a

Default Re: Redirecting to the New Location of a File. - 03-27-2009 , 09:55 AM



This is a little embarrassing since you said, "Can't get easier," but (*cough*
*cough*) how do I create a .htaccess file? In any text editor? (I'm on a Mac.)
What do I name the .htaccess file? I use Dreamhost as my service provider. Do I
need to place the file at the root address of my domain or at the root level of
the shared server? Thanks for the help.


Reply With Quote
  #7  
Old   
Murray *ACE*
 
Posts: n/a

Default Re: Redirecting to the New Location of a File. - 03-27-2009 , 10:01 AM



Ask Dreamhost. That's what you pay them for!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"***Jake***" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
This is a little embarrassing since you said, "Can't get easier," but
(*cough*
*cough*) how do I create a .htaccess file? In any text editor? (I'm on a
Mac.)
What do I name the .htaccess file? I use Dreamhost as my service provider.
Do I
need to place the file at the root address of my domain or at the root
level of
the shared server? Thanks for the help.



Reply With Quote
  #8  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Redirecting to the New Location of a File. - 03-27-2009 , 04:02 PM



..oO(***Jake***)

Quote:
This is a little embarrassing since you said, "Can't get easier," but (*cough*
*cough*) how do I create a .htaccess file? In any text editor? (I'm on a Mac.)
What do I name the .htaccess file? I use Dreamhost as my service provider. Do I
need to place the file at the root address of my domain or at the root level of
the shared server? Thanks for the help.
You're almost there. The name of the file is exactly as written
(including the leading dot). It's a simple text file and usually stored
in the root directory of the site, where the index.html/.php/... is.
There can also be other .htaccess files in subdirectories if necessary,
but the main stuff is usually done in the root directory.

You might still have to ask your host if this can be done, because it
usually requires an Apache webserver and the permission to use .htaccess
files (but all good hosts should allow it, because it's an important and
very powerful tool).

Micha


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.