vb.org Archive

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

DCteen 07-26-2016 06:40 AM

How to redirect url in .htaccess ?
 
Hello VB.org staff & coders

can someone please guide me, how do i redirect an url in .htaccess file

for example - i want to redirect url

http://www.example.com/search.php to http://www.example.net/search.php (same url just domain name is different)


*[i have searched query "how to redirect url in htaccess" before posting this thread but i didn't get anything useful]


Thank you :)

DivisionByZero 07-26-2016 06:47 AM

need more information.

just that ONE page (search.php)? or EVERYTHING .com to .net ??

DCteen 07-26-2016 06:53 AM

everything is done but few left i.e search.php / calander.php etc.. so i guess i have do them one by one ?

DivisionByZero 07-26-2016 06:55 AM

not necessarily. if you're moving the whole SITE, then you can do it with two lines of code, but if it's only a select few pages, then yes, it will have to be done individually

DCteen 07-26-2016 07:04 AM

whole SITE's url are redirecting to another already except few So, please guide me how do i do this ? The codes are ?
http://www.example.com/search.php to http://www.example.net/search.php (same url just domain name is different)

--------------- Added [DATE]1469524795[/DATE] at [TIME]1469524795[/TIME] ---------------

also let know the code / procedure how to redirect the whole site to another * (for my knowledge).

For now please let know how to redirect the mentioned URL .

Thank You

KevinL 07-26-2016 10:32 AM

Whole site to another

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?old\.com
RewriteRule (.*) http://www.new.com/$1 [R=301,L]

DCteen 07-26-2016 02:12 PM

Quote:

Originally Posted by KevinL (Post 2573962)
Whole site to another

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?old\.com
RewriteRule (.*) http://www.new.com/$1 [R=301,L]

Thanks KevinL

Noted ! Can you please let me know how do i redirect particular (Single) link as mentioned above ?

KevinL 07-26-2016 07:31 PM

Redirect 301 /oldfile.php http://example.net/newfile.php

That should work. But if you use the last one I wrote it should take care of all files and only need that one.


All times are GMT. The time now is 03:51 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.01002 seconds
  • Memory Usage 1,724KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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