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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2017, 11:43 AM
decentplayboy decentplayboy is offline
 
Join Date: Dec 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default VB4 .htaccess redirect old url to new url

Hi, i just changed my forum domain. I want to redirect all my existing google search result from old url to my new url

for example

i want to redirect the exact link as below

http://oldurl.com --> http://newurl.com

http://oldurl.com/forum --> http://newurl.com/forum

http://oldurl.com/forum/forumdisplay.php?f=275 --> http://newurl.com/forum/forumdisplay.php?f=275 (f=275 is for example)

http://oldurl.com/forum/showthread.php?t=7462 --> http://newurl.com/forum/showthread.php?t=7462 (t=7462 is for example)

http://oldurl.com/forum/showthread.p...l=1#post972978 --> http://newurl.com/forum/showthread.p...l=1#post972978

what is the .htaccess rewrite rule that serve this purpose? which .htaccess should i modify? public_html or /forum

your help is much appreciated. thanks
Reply With Quote
  #2  
Old 10-08-2017, 01:33 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll need several lines in your htaccess to cover everything.
See if you can catch joe (@BirdOPrey5) and ask him. He's helped me out before with regex code to handle redirecting all threads in a section.

You're htaccess would go in the root of your old url, or by your examples it could go in your forum folder put I would go root placement.
Reply With Quote
  #3  
Old 10-08-2017, 01:45 PM
decentplayboy decentplayboy is offline
 
Join Date: Dec 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Brandon Sheley View Post
You'll need several lines in your htaccess to cover everything.
See if you can catch joe (@BirdOPrey5) and ask him. He's helped me out before with regex code to handle redirecting all threads in a section.

You're htaccess would go in the root of your old url, or by your examples it could go in your forum folder put I would go root placement.
thanks alot brandon...i will pm bro birdOPrey5
Reply With Quote
  #4  
Old 10-08-2017, 09:35 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could take a look at http://www.inmotionhosting.com/suppo...t-via-htaccess which is almost exactly what you want.

As for your question that you PMed me (regarding fixing URL's in private messages), you can use the following query (add the table prefix if you use any):

HTML Code:
UPDATE pmtext SET message = REPLACE(message, 'olddomain.com', 'newdomain.com') WHERE message like '%olddomain.com%';
Reply With Quote
Благодарность от:
webmastersun
  #5  
Old 10-11-2017, 10:52 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're keeping the same URL structure on both domains then on the old domain, in the public_html folder, create an .htaccess file with this content:

Code:
RewriteEngine on 
RewriteRule ^(.*)$ http://www.newsite.com$1 [R=301,L]
Where you replace http://www.newsite.com with the base URL to your new domain.
Reply With Quote
Благодарность от:
Brandon Sheley
  #6  
Old 10-19-2017, 12:52 PM
webmastersun's Avatar
webmastersun webmastersun is offline
 
Join Date: Oct 2013
Location: www.webmastersun.com
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by decentplayboy View Post
Hi, i just changed my forum domain. I want to redirect all my existing google search result from old url to my new url

for example

i want to redirect the exact link as below

http://oldurl.com --> http://newurl.com

http://oldurl.com/forum --> http://newurl.com/forum

http://oldurl.com/forum/forumdisplay.php?f=275 --> http://newurl.com/forum/forumdisplay.php?f=275 (f=275 is for example)

http://oldurl.com/forum/showthread.php?t=7462 --> http://newurl.com/forum/showthread.php?t=7462 (t=7462 is for example)

http://oldurl.com/forum/showthread.p...l=1#post972978 --> http://newurl.com/forum/showthread.p...l=1#post972978

what is the .htaccess rewrite rule that serve this purpose? which .htaccess should i modify? public_html or /forum

your help is much appreciated. thanks
Using these .htaccess codes in this post https://forumweb.hosting/13528-how-t...g-the-url.html can help you out.

Hope it helps!
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 02:55 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.03818 seconds
  • Memory Usage 2,222KB
  • 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)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (2)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete