Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2013, 11:35 AM
xAnacondax xAnacondax is offline
 
Join Date: Feb 2012
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default htaccess 301 redirect assistance

First off... I've been searching around trying to do my homework on how to do this, and I found an example, but I'm not confident I understand the coding well enough to customize it for my current domain. We moved our forum from a subdirectory (http://www.example.com/forum) to the root (http://www.example.com) and ever since we've had issues with ajax functionality on the board both with some built in features of VB and by extension those plugins that use ajax to function. Looking at my cpanel logs leads me to believe that the files/database are looking for that old directory and getting a 404 error. I wanted to see if there was an easy to understand resource that I can go by in order to set up a redirect from the old directory path to my current one and see if it fixes the issues.

Namely, how to enter the redirect properly in the htaccess file...
And where to put it.... whether it should be inside the root folder (http://www.example.com) or within the (http://www.example.com/forum) directory. Unfortunately I'm suddenly needing to deal with extrememly limited experience and I want to make sure I have it right the first time since I'm fixing a live website.


Any help would be greatly appreciated
Reply With Quote
  #2  
Old 09-17-2013, 10:30 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems like you should be able to get things working without using a redirect (except to get existing links to point to the new forum, of course). Did you try Maintenance > General Update Tools > Rebuild Styles?
Reply With Quote
  #3  
Old 09-17-2013, 12:03 PM
Spangle Spangle is offline
 
Join Date: Jun 2011
Posts: 520
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are getting a 404 error then you need to set up a redirect for that, it will also cure any other 404's that may crop up.

any redirects should go in the .htaccess file, that way it becomes a server side demand, and it wont be noticed at all by the user.

to setup a 404 redirect you only need to add one line to your .htaccess

ErrorDocument 404 /index.php

If your files were on the same server, you shouldn't need to do a redirect, just move all of the files out of the forum folder, into public_html, all you should need to do then is alter some settings like the the image paths in the ACP.

If you must have a redirect, then add this to your .htaccess

# Redirect old file path to new file path
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 08:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03762 seconds
  • Memory Usage 2,174KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete