There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
antivirus audio avg avg 8 backup bios boot browser bsod computer cpu crash css desktop driver dvd email error excel explorer firefox firefox 3 freeze game graphics hard drive hardware help please hijackthis hjt hjt log install internet internet explorer itunes javascript lan laptop malware missing monitor msn network networking openoffice outlook outlook 2003 outlook express php popups problem router screen seo slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp wireless word
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: rewrite of old location to new (../old/ -> ../new/


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
madd74's Avatar
Computer Specs
Senior Member with 177 posts.
 
Join Date: Nov 2003
Location: Des Moines, IA
Experience: Advanced
14-May-2008, 11:18 PM #1
Solved: rewrite of old location to new (../old/ -> ../new/
Currently, I had moved my board over from one database to another, and in doing so, still have the old forum up, but would like it to point to the new. I would imagine this would be something with .htaccess and looking for the simple way to do this

http://madd74.com/forum/index.php

to

http://madd74.com/bb/index.php

so that "forum" and "bb" change, but everything after is the same, so if I had forum/newthing.html that it would then point to bb/newthing.html

Last few times I did not pay attention to .htaccess processes I ended up rending my whole site as a 500 server error

Thanks!
__________________
madd says check out Madd's World - Red Mage of the Net (madd74.com) or chat with me and friends live! or visit madd on myspace
Mudley's Avatar
Computer Specs
Member with 99 posts.
 
Join Date: Apr 2008
Experience: Advanced
14-May-2008, 11:26 PM #2
mod_rewrite is your answer

probably something like this:

RewriteEngine On
RewriteRule ^/forum/([0-9A-Za-z\-\.]+)$ /bb/$1 [L]

i'm not sure about the \. in the regular expression though, i've never done it quite like that. I can confirm and test and modify tomorrow though when i'm at work (would do it now, but it will interfere with CoD4 time)
colinsp's Avatar
Computer Specs
Member with 94 posts.
 
Join Date: Sep 2007
Location: Spain
Experience: Adv PC, int HTML, noob PHP
15-May-2008, 01:20 AM #3
Alternatively you can achieve the same thing with a domain / url redirect by using cPanel if that is what you host uses without delving into mod_rewrite.
tomdkat's Avatar
Computer Specs
Distinguished Member with 2,802 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
15-May-2008, 04:47 PM #4
Quote:
Originally Posted by Mudley View Post
i'm not sure about the \. in the regular expression though, i've never done it quite like that.
That's to "escape" the dot so the dot won't be used as a special character in the regular expression but as an actual "dot".

Peace...
Mudley's Avatar
Computer Specs
Member with 99 posts.
 
Join Date: Apr 2008
Experience: Advanced
15-May-2008, 08:25 PM #5
Quote:
Originally Posted by tomdkat View Post
That's to "escape" the dot so the dot won't be used as a special character in the regular expression but as an actual "dot".

Peace...
i know, thats why i added it :P
i just wasn't sure if thats exactly what the rule needed to be without testing it
tomdkat's Avatar
Computer Specs
Distinguished Member with 2,802 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
16-May-2008, 10:24 AM #6
Ah, gotcha.

Peace...
madd74's Avatar
Computer Specs
Senior Member with 177 posts.
 
Join Date: Nov 2003
Location: Des Moines, IA
Experience: Advanced
17-May-2008, 02:08 AM #7
Quote:
Originally Posted by colinsp View Post
Alternatively you can achieve the same thing with a domain / url redirect by using cPanel if that is what you host uses without delving into mod_rewrite.
That actually worked exactly as I was looking for Thanks!
Reply

Tags
mod_rewrite


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:24 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.