Jump to content

Changing Friendly URL


hmikko

Recommended Posts

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

? it's getting a bit funny already. Now it's Oh my heavens&#33;.

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

? it's getting a bit funny already. Now it's Oh my heavens&#33;.

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

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

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 ) );

tiJdea9.png

after configure furl from admin side:
UYWOaLf.png

{@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

  • 2 months later...
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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...