• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 phpBB3 Seo urls

#1
Hello

I need help with setting urls like in phpBB3 (with seo ultimate)

XF forum url:
domain.com/forums/forum-name.1/
phpBB3 forum url:
domain.com/forum-name-f1

XF topic url
domain.com/threads/topic-name.1
phpBB3 topic url
domain.com/forum-name-f1/topic-name-t1

XF post url
domain.com/threads/topic-name.1/#post-1
phpBB3 post url
domain.com/forum-name-f1/topic-name-t1#p1

XF member profile url:
domain.com/members/username.1/
phpBB3 member profile url:
domain.com/member1.html


I need to get rid of XF prefixes (threads, forums etc)
or place them in shorten form between forum/topic name and ID

In route filters, i tried edit forum urls:
forums/{name}.{name:digit}/
replace
{name}-f{name:digit}/

But i get message that prefix should be first. Why ? (It's very stupid)

I have over 200k posts and many internal linking
I can't affort to loose that.
 

Mike

XenForo developer
Staff member
#2
A prefix identifies the type of content as is necessary to make URLs unambiguous.

You would need to use 301s to redirect your old URLs to your new ones. We may be able to help with that if you're not comfortable putting these matches together.
 
#3
I don't want get rid prefixes entirely

I just want to make prefix: forums as "f", threads as "t" and placed them in diferent position.

Please help me do that,

301 Redirection will not cut it.
Because i have lots of internal links to topics/posts/forums
And if I even replaced them in database to xenforo look, search engines will not be happy,
Beside that, i have many links on external sites linking to forums topics etc.

I read that 301 Redirection for phpbb3 is not completly done:
https://xenforo.com/community/resources/phpbb3-redirection-script-seo-urls-apache-nginx.2166/

So , |I'm asking for help with those prefixes ;)

Thanks you
 

Mike

XenForo developer
Staff member
#7
Untested, but I believe these should work when placed at the top of your .htaccess (assuming Apache):
Code:
RewriteEngine On
RewriteRule -f([0-9]+)$ /forums/$1/ [R=301,L]
RewriteRule -t([0-9]+)$ /threads/$1/ [R=301,L]
RewriteRule member([0-9]+)\.html$ /members/$1/ [R=301,L]
Note that your post URLs can't be redirected as the part after the # is never sent to the server.
 
#8
Yes, I'm using Apache

But It's not working.

My xenforo .htaccess:
Code:
#   Mod_security can interfere with uploading of content such as attachments. If you
#   cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#   SecFilterEngine Off
#   SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule -f([0-9]+)$ /forums/$1/ [R=301,L]
   RewriteRule -t([0-9]+)$ /threads/$1/ [R=301,L]
   RewriteRule member([0-9]+)\.html$ /members/$1/ [R=301,L]
   #   If you are having problems with the rewrite rules, remove the "#" from the
   #   line that begins "RewriteBase" below. You will also have to change the path
   #   of the rewrite to reflect the path to your XenForo installation.
   #RewriteBase /xenforo

   #   This line may be needed to enable WebDAV editing with PHP as a CGI.
   #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -l [OR]
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule ^.*$ - [NC,L]
   RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
   RewriteRule ^.*$ index.php [NC,L]
</IfModule>

Please check it yourself,

site:http://programyzadarmo.net.pl

Browse to eg. page 3 - google search

Urls to forums, topics, posts, members not working
 

Mike

XenForo developer
Staff member
#9
From what I can see, the URLs in Google are different than the URLs you've lin the first post. While I don't see many of them, notably, your forum URLs have a trailing slash which wasn't in the example URL.

That would be this:
Code:
RewriteRule -f([0-9]+)/?$ /forums/$1/ [R=301,L]
I see post links that would appear to redirect like this:
Code:
RewriteRule post([0-9]+)\.html$ /posts/$1/ [R=301,L]
I don't see any thread or member links in Google, but when I use the example URLs given in the first post, they are redirected as suggested.

If there are any other issues with redirection, please confirm them in an incognito browser window or use unique URLs to test each time as otherwise you may be running into browser caching. If you still have problems with redirections, then I'd need exact URLs that aren't redirecting like you expect.