hmikko Posted August 1, 2015 Share Posted August 1, 2015 Hello,I would like to make all my forum topic URLs from http://forum.example.com/topic/123-hellow-world/ to http://forum.example.com/teema/123-hello-world/ but don't want to frighten Google so would like to redirect 301 those to a new URL. I have searched from Google the right htaccess code but non of them work.Can somebody help me out? Link to comment Share on other sites More sharing options...
Adlago Posted August 1, 2015 Share Posted August 1, 2015 Add to your htaccess<IfModule mod_rewrite.c> //301 Redirect Old File redirect 301 /topic/123-hellow-world/ /teema/123-hello-world/ </IfModule> Link to comment Share on other sites More sharing options...
hmikko Posted August 1, 2015 Author Share Posted August 1, 2015 Sorry, I've been misunderstood - I want to rewrite only /topic/ to /teema/, so Google links won't break until it indexes new URL. Link to comment Share on other sites More sharing options...
Adlago Posted August 2, 2015 Share Posted August 2, 2015 Sorry, I've been misunderstood - I want to rewrite only /topic/ to /teema/, so Google links won't break until it indexes new URL.Add this<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} ^/topic/?$ RewriteRule ^(.*) http://yoursait.com/teema/ [R=301,L] </IfModule> Link to comment Share on other sites More sharing options...
hmikko Posted August 2, 2015 Author Share Posted August 2, 2015 I got "The page you requested does not exist" after going to /topic/ Link to comment Share on other sites More sharing options...
Adlago Posted August 2, 2015 Share Posted August 2, 2015 Perhaps your link "http://yoursait..." you is not accurate Link to comment Share on other sites More sharing options...
Adlago Posted August 2, 2015 Share Posted August 2, 2015 http://forum.example.com/topic/123-hellow-world/ to http://forum.example.com/teema/123-hello-world/This is probably a sub domain link? If so, it should save it<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} ^/forum/topic/?$ RewriteRule ^(.*) http://example.com/forum/teema/ [R=301,L] </IfModule> Link to comment Share on other sites More sharing options...
Ilya Hoilik Posted August 2, 2015 Share Posted August 2, 2015 AdminCP → Settings → Advanced Configuration → Friendly URLs. Change what you need. Link to comment Share on other sites More sharing options...
hmikko Posted August 2, 2015 Author Share Posted August 2, 2015 ? it's getting a bit funny already. Now it's Oh my heavens!.Lets start all over.1. Right now all my topic URLs are like http://forum.example.com/topic/123-hello-world/ 2. I (already) CHANGED Friendly URLs to show topics like http://forum.example.com/teema/123-hello-world/3. Now Google can't find my topics because the URL has changed. So I wanted to redirect old URLs to new when somebody clicks it in search engine. With code 301.Am I the only one who understands? ? Can't explain it any other way. Link to comment Share on other sites More sharing options...
Ilya Hoilik Posted August 2, 2015 Share Posted August 2, 2015 <IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} ^/topic/$ RewriteRule ^.*$ /teema/? [R=301,L] </IfModule> Link to comment Share on other sites More sharing options...
Max_69 Posted August 2, 2015 Share Posted August 2, 2015 <IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} ^/topic/$ RewriteRule ^.*$ /teema/? [R=301,L] </IfModule> Hello, but if, for example, I would change topic with the name of the section? Link to comment Share on other sites More sharing options...
BomAleold Posted August 3, 2015 Share Posted August 3, 2015 this only if into furl is possible to set variables of forum section.. i check later . good question... Link to comment Share on other sites More sharing options...
Adlago Posted August 3, 2015 Share Posted August 3, 2015 ? it's getting a bit funny already. Now it's Oh my heavens!.Lets start all over.1. Right now all my topic URLs are like http://forum.example.com/topic/123-hello-world/ 2. I (already) CHANGED Friendly URLs to show topics like http://forum.example.com/teema/123-hello-world/3. Now Google can't find my topics because the URL has changed. So I wanted to redirect old URLs to new when somebody clicks it in search engine. With code 301.Am I the only one who understands? ? Can't explain it any other way.123-hello-world/ whether folder?forum.example.com whether subdomains? Link to comment Share on other sites More sharing options...
Adlago Posted August 3, 2015 Share Posted August 3, 2015 Hello, but if, for example, I would change topic with the name of the section?It has been tested and works.Enter the name of the your folder.<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} ^/old_folder/?$ RewriteRule ^(.*) http://yoursait.com/new_folder/ [R=301,L] </IfModule> Link to comment Share on other sites More sharing options...
Max_69 Posted August 3, 2015 Share Posted August 3, 2015 This is correct? I have the forum in the forum folder.Thanks Link to comment Share on other sites More sharing options...
Adlago Posted August 3, 2015 Share Posted August 3, 2015 This is correct? I have the forum in the forum folder.ThanksWrite your old and your new link to your answer. Link to comment Share on other sites More sharing options...
Max_69 Posted August 3, 2015 Share Posted August 3, 2015 Write your old and your new link to your answer.Maybe we have not understood ... I want the word topic is changed to the name of the section and for the entire board Link to comment Share on other sites More sharing options...
VDAR Posted August 3, 2015 Share Posted August 3, 2015 how do we write if we are running this forum on windows Link to comment Share on other sites More sharing options...
BomAleold Posted August 4, 2015 Share Posted August 4, 2015 Max I have replied on invisionita, if you would topic link as: http://localhost/ips4/index.php?/a-test-forum/t/1-welcome/ you must make a edit on function url() of file applications\forums\sources\Topic\Topic.php find: $this->_url[ $_key ] = \IPS\Http\Url::internal( "app=forums&module=forums&controller=topic&id={$this->tid}", 'front', 'forums_topic', array( $this->title_seo ) ); replace with: $this->_url[ $_key ] = \IPS\Http\Url::internal( "app=forums&module=forums&controller=topic&id={$this->tid}&forum_name={$this->container()->name_seo}", 'front', 'forums_topic', array( $this->title_seo ) ); after configure furl from admin side: {@forum_name} is variable that include the name of section/forum container/parent... this is not very good... because some topics couldn't show the name of section/forum that contain them...pay many attention please. Link to comment Share on other sites More sharing options...
Murmel Posted October 16, 2015 Share Posted October 16, 2015 On 4.8.2015,, BomAle said: Max I have replied on invisionita, {@forum_name} is variable that include the name of section/forum container/parent... this is not very good... because some topics couldn't show the name of section/forum that contain them... pay many attention please. Where can I find the variables? What do you mean with: this is not very good... because some topics couldn't show the name of section/forum that contain them... pay many attention please. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.