Jump to content


htaccess redirect


7 replies to this topic

#1 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 24 June 2006 - 06:48 PM

quick question: how can i redirect a page in a directory, e.g. pstutorials/page.php to http://tutorials.scudworkz.com

now, the page.php is any page in the pstutorials/ folder. is it possible?

#2 Donna

    Retired P2L Queen!

  • P2L Staff
  • PipPipPipPip
  • 12,330 posts
  • Gender:Female
  • Location:B.C Canada

Posted 24 June 2006 - 06:54 PM

Have a look at

http://www.spoono.co...torial.php?id=3

#3 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 24 June 2006 - 10:15 PM

that would work except that i need to use htaccess because i plan on deleting the old files but don't want to break all the link-backs i have

#4 Hayden

    P2L Jedi

  • Members
  • PipPipPip
  • 716 posts
  • Gender:Male
  • Location:Texas

Posted 24 June 2006 - 10:50 PM

RedirectMatch permanent ^/path/to/file.html$ http://www.google.com

something like that?

#5 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 24 June 2006 - 11:01 PM

not that simple. lets say i have 3 files in dir/, so i have "dir/file1.htm", "dir/file2.htm", "dir/file3.htm".

i need a code that can redirect all three of those files to one directory without having to do it one by one.

i also need it so that "dir/file1.htm" doesn't redirect to "otherdir/file1.tm", i just need to to go to "otherdir/"

#6 Hayden

    P2L Jedi

  • Members
  • PipPipPip
  • 716 posts
  • Gender:Male
  • Location:Texas

Posted 24 June 2006 - 11:13 PM

RedirectMatch permanent ^/path/to/page([0-9-]+).html$ http://www.google.com

something like that to accept page1.html or any number?

Edited by SpatialVisionary, 25 June 2006 - 01:08 AM.


#7 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 24 June 2006 - 11:56 PM

RedirectMatch permanent ^/(.+)/(.*)$ http://$1.scudworks.com
If either of Spatial's code's would work, then the above would be my best guess. I've never used the particular function in .htaccess that's being used, nor have i redirected to sub-domains before. So i can't honestly say this will work, but it's worth a shot.

#8 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 25 June 2006 - 12:37 PM

alright, it's all sorted out, heres what i was trying to do:
RedirectMatch permanent ^/ps_tutorials/(.*)$ http://tutorials.scudworkz.com/list/ps//

so thanks fellas. :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users