vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   301 redirect - need help please.. (https://vborg.vbsupport.ru/showthread.php?t=151795)

Yellow Slider 07-09-2007 02:31 PM

301 redirect - need help please..
 
I need to 301 redirect like that -
www.domain.com/dir/index.php

will be redirected to

www.anotherdomain.com/index.php

and all the other pages as well,
for example
www.domain.com/dir/forumdisplay.php?f=92

will 301 redircet to
www.anotherdomain.com/forumdisplay.php?f=92
and all the posts and threads as well..

thanks a lot for the help.

Dismounted 07-10-2007 04:18 AM

You should be able to create redirects using your hosting control panel (ie. cPanel, Plesk, etc.).

Yellow Slider 07-10-2007 05:00 AM

not this types of redirects.
i can do just basic redirect with my DA server panel.

Dismounted 07-10-2007 05:07 AM

What do they put into the .htaccess file?

Eikinskjaldi 07-10-2007 05:24 AM

Quote:

Originally Posted by Yellow Slider (Post 1286788)
I need to 301 redirect like that -
www.domain.com/dir/index.php

will be redirected to

www.anotherdomain.com/index.php

and all the other pages as well,
for example
www.domain.com/dir/forumdisplay.php?f=92

will 301 redircet to
www.anotherdomain.com/forumdisplay.php?f=92
and all the posts and threads as well..

thanks a lot for the help.

I haven't tested this, but try putting this into your .htaccess file

Code:

RewriteEngine On
RewriteRule www\.domain\.com/dir/(.*) www.anotherdomain.com/$1


Yellow Slider 07-10-2007 06:06 AM

it doesn't work , at all, it isn't redirecting thanks for trying,
can you please try giving me another code to try? it's very urgent.

thanks.

Eikinskjaldi 07-10-2007 06:52 AM

Quote:

Originally Posted by Yellow Slider (Post 1287367)
it doesn't work , at all, it isn't redirecting thanks for trying,
can you please try giving me another code to try? it's very urgent.

thanks.

Nope, sorry, thats all I got. If that doesn't work, my next suggestion would be to "play around with it"


I am not sure what format .htaccess receives requests, I do all my rewriting in httpd.conf.

maybe it doesnt get the domain name?

try
RewriteRule dir/(.*) http://otherdomain.com/$1

Yellow Slider 07-10-2007 09:49 AM

I can rewrite httpd.conf, what do i need to add \ edit?

vB Nova 07-10-2007 09:58 AM

Code:

Options +FollowSymLinks
RewriteEngine on
RewriteRule dir/(.*) http://www.newdomain.com/$1 [R=301,L]

Have Phun :)

cyberphr 07-10-2007 10:08 AM

Don't you mean 401?

Dismounted 07-10-2007 10:41 AM

It's 301 (Permanently Moved). You're probably thinking of 404 (Page Not Found)?

Yellow Slider 07-10-2007 11:13 AM

Nope, I'm thinking on 301,
I have 2 forums, and one of then is located in a directory, i'm moving it to it's own domain (it's about time.. )

and the code isn't working (VB NOVA)
can it be because i have another htaccess file in the root folder? cous nothing had happened :

vB Nova 07-10-2007 11:17 AM

Yeah, you can merge the two files or if you don't know how/think you'll mess something up. Paste the other one here and I'll do it.

Yellow Slider 07-10-2007 11:20 AM

this is the root folder htaccess file
Code:

RewriteEngine On


RewriteEngine On
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)
RewriteRule ^(.*)$ $1 [L]


# SEO Videos
# https://vborg.vbsupport.ru/showthread.php?p=1117273

# ofcourse you can rename videos.html and make it for example a non existing directory /videos/ and /videos/videoindex-20.xhtml etc.

RewriteCond %{HTTP_HOST} !^www\.atraf-f\.net
RewriteRule (.*) http://www.atraf-f.net/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html&page=([0-9]+)$ http://www.atraf-f.net/videos-page$1.html [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html$ index.php?videos=1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos-page([0-9]+)\.html$ index.php?videos=$1 [L]


there is a board in the base domain, in a directory inside the base domain there is another board , and i want to redirect the files in the directory to a new domain (on the same server..)

thanks a lot :)

vB Nova 07-10-2007 02:16 PM

Code:

Options +FollowSymLinks
RewriteEngine on

RewriteRule /upload/(.*) http://www.atraf-f.net/$1

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)
RewriteRule ^(.*)$ $1 [L]

RewriteCond %{HTTP_HOST} !^www\.atraf-f\.net
RewriteRule (.*) http://www.atraf-f.net/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html&page=([0-9]+)$ http://www.atraf-f.net/videos-page$1.html [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html$ index.php?videos=1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos-page([0-9]+)\.html$ index.php?videos=$1 [L][R=301,L]


Yellow Slider 07-10-2007 02:22 PM

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

:\

vB Nova 07-10-2007 02:24 PM

Code:

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^upload/(.*)$ http://www.atraf-f.net/$1

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)
RewriteRule ^(.*)$ $1 [L]

RewriteCond %{HTTP_HOST} !^www\.atraf-f\.net
RewriteRule (.*) http://www.atraf-f.net/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html&page=([0-9]+)$ http://www.atraf-f.net/videos-page$1.html [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html$ index.php?videos=1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos-page([0-9]+)\.html$ index.php?videos=$1 [L][R=301,L]


If that doesn't work try:
Code:

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^upload\/(.*)$ http://www.atraf-f.net/$1

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)
RewriteRule ^(.*)$ $1 [L]

RewriteCond %{HTTP_HOST} !^www\.atraf-f\.net
RewriteRule (.*) http://www.atraf-f.net/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html&page=([0-9]+)$ http://www.atraf-f.net/videos-page$1.html [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html$ index.php?videos=1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos-page([0-9]+)\.html$ index.php?videos=$1 [L][R=301,L]


Yellow Slider 07-10-2007 05:30 PM

it redirects, but not in a good way, it lets me browse the forum like if the forum is located in the folder, instead moving me to the same path at the other domain :\

please try to help me..

vB Nova 07-10-2007 05:46 PM

What's the first domain so I can see & what code did you use, the first or the second?

Yellow Slider 07-10-2007 07:48 PM

both of them are doing the same thing,
the basic domain is
http://www.atraf-f.net
and the board that is located in http://www.atraf-f.net/upload (i've uploaded this board just to check the script) the real board is in an other directory..
it now has
RewriteRule ^upload\/(.*)$ http://www.atraf-f.net/$1

vB Nova 07-11-2007 10:03 AM

You removed the [R=301,L] :p
Code:

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^upload\/(.*)$ http://www.atraf-f.net/$1 [R=301,L]

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteCond %{REQUEST_FILENAME} (admincp|modcp|clientscript|cpstyles|images)
RewriteRule ^(.*)$ $1 [L]

RewriteCond %{HTTP_HOST} !^www\.atraf-f\.net
RewriteRule (.*) http://www.atraf-f.net/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html&page=([0-9]+)$ http://www.atraf-f.net/videos-page$1.html [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos\.html$ index.php?videos=1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^videos-page([0-9]+)\.html$ index.php?videos=$1 [L][R=301,L]


Yellow Slider 07-11-2007 12:42 PM

Thanks a lot :D !!

vB Nova 07-11-2007 04:14 PM

No Problem, Enjoy!.


All times are GMT. The time now is 06:58 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.01710 seconds
  • Memory Usage 1,769KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)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