Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
hmikko Posted August 1, 2015 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?
Adlago Posted August 1, 2015 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>
hmikko Posted August 1, 2015 Author 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.
Adlago Posted August 2, 2015 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>
hmikko Posted August 2, 2015 Author Posted August 2, 2015 I got "The page you requested does not exist" after going to /topic/
Adlago Posted August 2, 2015 Posted August 2, 2015 Perhaps your link "http://yoursait..." you is not accurate
Adlago Posted August 2, 2015 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>
Ilya Hoilik Posted August 2, 2015 Posted August 2, 2015 AdminCP → Settings → Advanced Configuration → Friendly URLs. Change what you need.
hmikko Posted August 2, 2015 Author 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.
Ilya Hoilik Posted August 2, 2015 Posted August 2, 2015 <IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} ^/topic/$ RewriteRule ^.*$ /teema/? [R=301,L] </IfModule>
Max_69 Posted August 2, 2015 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?
BomAleold Posted August 3, 2015 Posted August 3, 2015 this only if into furl is possible to set variables of forum section.. i check later . good question...
Adlago Posted August 3, 2015 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?
Adlago Posted August 3, 2015 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>
Max_69 Posted August 3, 2015 Posted August 3, 2015 This is correct? I have the forum in the forum folder.Thanks
Adlago Posted August 3, 2015 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.
Max_69 Posted August 3, 2015 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
VDAR Posted August 3, 2015 Posted August 3, 2015 how do we write if we are running this forum on windows
BomAleold Posted August 4, 2015 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.
Murmel Posted October 16, 2015 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.