vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   VB4 .htaccess redirect old url to new url (https://vborg.vbsupport.ru/showthread.php?t=325659)

decentplayboy 10-08-2017 11:43 AM

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

Brandon Sheley 10-08-2017 01:33 PM

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.

decentplayboy 10-08-2017 01:45 PM

Quote:

Originally Posted by Brandon Sheley (Post 2590339)
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

Dave 10-08-2017 09:35 PM

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%';

BirdOPrey5 10-11-2017 10:52 AM

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.

webmastersun 10-19-2017 12:52 PM

Quote:

Originally Posted by decentplayboy (Post 2590337)
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!


All times are GMT. The time now is 02:41 AM.

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.00981 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete