@Royals
The ids are the same so you don't need these scripts. Just place these rules at the top of the .htaccess in web root:
Code:RewriteEngine On RewriteRule ^forums/forum\.php$ /forums/ [R=301,L] RewriteRule ^forums/forumdisplay\.php/([0-9]+)-.*$ /forums/$1/ [R=301,L] RewriteRule ^forums/member\.php/([0-9]+)-.*$ /members/$1/ [R=301,L] RewriteRule ^forums/showthread\.php/([0-9]+)-.*$ /threads/$1/ [R=301,L]
Hi @Jake,
thank you for the fast answer. The examples are:
HTML:Forum: old: http://www.kubaforum.eu/thema/9901-Moin-Moin new: http://dev.kubaforum.eu/threads/moin-moin.9901/ Thread: old: http://www.kubaforum.eu/thema/9587-Ich-bin-ganz-aufgeregt new: http://www.kubaforum.eu/thema/9587-Ich-bin-ganz-aufgeregt Post: http://www.kubaforum.eu/thema/9688-Vorstellung-)?p=27061&viewfull=1#post27061 http://dev.kubaforum.eu/threads/vorstellung.9688/#post-27061 Member: old: http://www.kubaforum.eu/mitglied/2706-Susa new: http://dev.kubaforum.eu/members/susa.2706/
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|\?)p=([0-9]+)($|&)
RewriteRule ^thema/([0-9]+)-.*$ http://dev.kubaforum.eu/posts/%2/? [R=301,L]
RewriteRule ^thema/([0-9]+)-.*$ http://dev.kubaforum.eu/threads/$1/? [R=301,L]
RewriteRule ^mitglied/([0-9]+)-.*$ http://dev.kubaforum.eu/members/$1/? [R=301,L]
I'm importing with same Content IDs, regular vB4 (not vBSEO), "basic" URL, same number of messages per page (10) - but these rules aren't working.
First, I need to use ? instead of /, because I have basic URLs. But when I use question marks:
RewriteRule ^forums/showthread\.php?([0-9]+)-.*$ /threads/$1/ [R=301,L]
It does not match.
My other concern is around showthread.php - how can I include page numbers and post #?
Here is what I'm trying to make happen:
First Page
vBulletin:
https://www.mysite.com/showthread.php?32279-Sharing-gardening
xenForo:
https://www.mysite.com/threads/sharing-gardening.32279/
Second Page
vBulletin:
https://www.mysite.com/showthread.php?32279-Sharing-gardening/page2
xenForo:
https://www.mysite.com/threads/sharing-gardening.32279/page-2
Specific post on first page
vBulletin:
https://www.mysite.com/showthread.php?32279-Sharing-gardening&p=444958&viewfull=1#post444958
xenForo:
https://www.mysite.com/threads/sharing-gardening.32279/#post-444958
Specific post on second page
vBulletin:
https://www.mysite.com/showthread.php?32279-Sharing-gardening&p=444958&viewfull=1#444958
xenForo:
https://www.mysite.com/threads/sharing-gardening.32279/page-2#post-444958
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|\?|&)p=([0-9]+)($|&)
RewriteRule ^showthread\.php$ /posts/%2/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-[^/]+/page([0-9]+)$
RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
Query string (after ?) checking is a little different.
Add these rules to the top of the .htaccess file in your web root:
Code:RewriteEngine On RewriteCond %{QUERY_STRING} (^|\?|&)p=([0-9]+)($|&) RewriteRule ^showthread\.php$ /posts/%2/? [R=301,L] RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-[^/]+/page([0-9]+)$ RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L] RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$ RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
That will take care of threads, paginated threads, and posts.
# Home
RewriteRule ^forum\.php$ /xf/? [R=301,L]
# Forums + Pagination
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-[^/]+/page([0-9]+)$
RewriteRule ^forumdisplay\.php$ /xf/forums/%2/page-%3? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^forumdisplay\.php$ /xf/forums/%2/? [R=301,L]
# Threads + Pagination
RewriteCond %{QUERY_STRING} (^|\?|&)p=([0-9]+)($|&)
RewriteRule ^showthread\.php$ /xf/posts/%2/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-[^/]+/page([0-9]+)$
RewriteRule ^showthread\.php$ /xf/threads/%2/page-%3? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^showthread\.php$ /xf/threads/%2/? [R=301,L]
# Member
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^member\.php$ /xf/members/%2/? [R=301,L]
# Archive
RewriteRule ^archive/index\.php/t-([0-9]+)\.html$ /xf/threads/$1 [R=301,L]
RewriteRule ^archive/index\.php/f-([0-9]+)\.html$ /xf/forums/$1 [R=301,L]
# CMS -> RM (we made a custom importer)
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^content\.php$ /xf/resources/%2/? [R=301,L]
# Print Thread
RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
RewriteRule ^printthread\.php$ /xf/threads/%1? [R=301,L]
# Show Post
RewriteCond %{QUERY_STRING} p=([0-9]+)(&|$)
RewriteRule ^showpost\.php$ /xf/posts/%1? [R=301,L]
# Attachments
RewriteCond %{QUERY_STRING} attachmentid=([0-9]+)(&|$)
RewriteRule ^attachment\.php$ /xf/attachments/%1? [R=301,L]
# 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
# 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]
RewriteRule ^/showthread.php /showthread.php;
RewriteRule ^/forumdisplay.php /forumdisplay.php;
</IfModule>
Not working for me. Some url are not redirects. Please let me know that how to get working?
Working : http://www.nirmoladda.com/showthread.php?141644&p=772627#post772627
Not working: http://www.nirmoladda.com/showthrea...-been-submitted-by-Love4U&p=509184#post509184
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|\?|&)p=([0-9]+)($|&)
RewriteRule ^showthread\.php$ /posts/%2/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-[^/]+/page([0-9]+)$
RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|\?|&)p=([0-9]+)($|&)
RewriteRule ^showthread\.php$ /posts/%2/? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-[^/]+/page([0-9]+)$
RewriteRule ^showthread\.php$ /threads/%2/page-%3? [R=301,L]
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-.*$
RewriteRule ^showthread\.php$ /threads/%2/? [R=301,L]
# 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
# 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>
We are just trying to redirect our tags from vBulletin to the XenForo forum home page. Seems simple right? Its simply not working. We've tried 100 variations. None work.
This is the goal. Can you get it to work?
Make this URL: http://www.hairlosstalk.com/interact/tags.php?tag=psoriasis
Go to: https://www.hairlosstalk.com/interact/
We have tried the following and none work:
RewriteRule ^tags.php$ https://www.hairlosstalk.com/interact/ [L,R=301,NC]
RewriteRule ^tags\.php/(.*) /interact/ [L,R=301]
RewriteRule ^tags\.php/(.*)$ /interact/ [L,R=301]
RewriteRule ^tags\.php/$ /interact [L,R=301]
Note: We are also redirecting vbulletin HTTP to xenforo HTTPS during this migration. So that redirect is also in the file.
RewriteRule ^tags\.php$ /interact/? [R=301,L]
RewriteEngine On
RewriteRule ^threads/([0-9]+)- /showthread.php?t=$1 [R=301,L]
# New Change (Vbulletin to XenForo)
RewriteCond %{THE_REQUEST} ^GET\ /maxcon_forums/
RewriteRule ^maxcon_forums/(.*) /forums/$1 [L,R=301]
# Convert All (Vbulletin URLs to XenForo system)
RewriteRule ^forums/threads/([0-9]+)- /showthread\.php?t=$1 [R=301,L]
RewriteRule ^forums/forums/([0-9]+)-(.*) /forumdisplay\.php?f=$1 [R=301,NC,L]
RewriteRule ^index\.php$ /forums/? [R=301,L]
RewriteRule ^forum\.php$ /forums/? [R=301,L]
RewriteRule ^news\.php$ /? [R=301,L]
# Convert All (Vbulletin URLs to XenForo system)
RewriteRule ^threads/([0-9]+)- /showthread\.php?t=$1 [R=301,L]
RewriteRule ^forums/([0-9]+)-(.*) /forumdisplay\.php?f=$1 [R=301,NC,L]
RewriteRule ^members/([0-9]+)- /member\.php?u=$1 [R=301,L]
# Old style Vbulletin links
http://www.maxconsole.com/maxcon_forums/showthread.php?195483-Fix-it-Felix-leaked-online
http://www.maxconsole.com/maxcon_forums/member.php?506190-Osmund-Neuron
# Friendly Vbulletin links
http://www.maxconsole.com/maxcon_forums/threads/294184-RUMOR-Streaming-of-Xbox-One-Games-to-Mobile
http://www.maxconsole.com/maxcon_forums/members/506190-Osmund-Neuron
# Old Forums
http://www.maxconsole.com/maxcon_forums/forums/222-MaxConsole-General-Gaming-News
# Archive Pages
http://www.maxconsole.com/maxcon_forums/archive/index.php/t-283878.html
# Special Forums
http://www.maxconsole.com/maxcon_forums/forums/108-Official-Gateway-3DS-Support-Forum
# Old Crunch Forums
http://www.ps3crunch.net/forum/forums/18-Official-Codename-REBUG-Support
# Old index pages
http://www.maxconsole.com/maxcon_forums/index.php --> to /forums
http://www.maxconsole.com/maxcon_forums/forum.php --> to /forums
http://www.maxconsole.com/maxcon_forums/news.php --> to front page
# Attachments
http://www.maxconsole.com/maxcon_forums/attachment.php?attachmentid=35588&d=1396402693
So, if you have an old link like this:http://www.domain.com/forum/showthread.php?44259
Then going there will just bring you to the homepage, and you better hope you know the link and know how to turn it into the new format of http://www.domain.com/forum/threads/44259, or else you can't find the topic. If you have the name of the topic in the link too, it works, but the number used to be fine and now it isn't. OK, that's not so bad if you know what to do. But...
How about if you have an old "permalink" to a post? https://www.domain.com/forum/showthread.php?1788-Test-Thread&p=1126528#post1126528 This isn't some random link I came up with, but actually a link from the a page on the official wiki of the site. OK, now how do I find the post? If you look at the format of a post "permalink", and then paste that post number in there, you get nothing useful because the URL has to include the page number too! That is, it goes to the page number in the URL and then shows you the post if it's there. But how to get the page number? I honestly can't think of any way to get to that post, short of manually doing some kind of binary search through the pages of the thread to see where that post number might be.
We use essential cookies to make this site work, and optional cookies to enhance your experience.