How to make redirect rules?

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
Locked
User avatar
thatgamesguy
Registered User
Posts: 10
Joined: Tue Jan 07, 2014 11:29 pm

How to make redirect rules?

Post by thatgamesguy » Fri Oct 28, 2016 3:49 pm

Hey everyone, I'm more or less in a jam here.

I had to revert my forum to an old state after getting spammed/hacked/destroyed...

More or less all the plugins were then broke, so I decided to update to 3.1


I have got phpbb3.1 running somewhat stable, however I don't have the ultimate SEO plugin to generate a htaccess file for the redirects. The installation is original with no mods now.

I basically need to create a rewrite rule to match them now.

Here is how the old url looked

Code: Select all

http://www.hiddenbelow.com/forums/neopets/pet-got-stolen-during-pound-transfer-t27848.html
and of course the new url

Code: Select all

http://www.hiddenbelow.com/forums/viewtopic.php?f=8&t=27848
I will take any insight you can give me on this as I can't figure out what to do from here.


Old .htaccess

Code: Select all


# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^www\.hiddenbelow\.com$ [NC]
# RewriteRule ^(.*)$ http://www.hiddenbelow.com/$1 [QSA,L,R=301]

# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^forums/forum\.html$ /forums/index.php [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^forums/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /forums/viewforum.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^forums/(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forums/viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^forums/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forums/viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^forums/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /forums/download/file.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES THROUGH USERNAME
RewriteRule ^forums/member/([^/]+)/?$ /forums/memberlist.php?mode=viewprofile&un=$1 [QSA,L,NC]
# USER MESSAGES THROUGH USERNAME
RewriteRule ^forums/member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /forums/search.php?author=$1&sr=$2&start=$4 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^forums/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /forums/memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^forums/post([0-9]+)\.html$ /forums/viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^forums/active-topics(-([0-9]+))?\.html$ /forums/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^forums/unanswered(-([0-9]+))?\.html$ /forums/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^forums/newposts(-([0-9]+))?\.html$ /forums/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# UNREAD POSTS
RewriteRule ^forums/unreadposts(-([0-9]+))?\.html$ /forums/search.php?search_id=unreadposts&start=$2 [QSA,L,NC]
# THE TEAM
RewriteRule ^forums/the-team\.html$ /forums/memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

#####################################################
# GYM Sitemaps & RSS
# Global channels
RewriteRule ^forums/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ /forums/gymrss.php?channels&$2&$4&$6 [QSA,L,NC]
# HTML Global news & maps
RewriteRule ^forums/(news|maps)/?(page([0-9]+)\.html)?$ /forums/map.php?$1&start=$3 [QSA,L,NC]
# END GYM Sitemaps & RSS
#####################################################

# FORUM WITHOUT ID & DELIM ALL MODES
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^forums/([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /forums/viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^forums/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /forums/$1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^forums/.+/(styles/.*|images/.*)/$ /forums/$1 [QSA,L,NC,R=301]
# END PHPBB PAGES
#####################################################

#####################################################
# GYM Sitemaps & RSS
# HTML Module additional modes
RewriteRule ^forums/(news|maps)/([a-z0-9_-]+)(/([a-z0-9_-]+))?/?(page([0-9]+)\.html)?$ /forums/map.php?$2=$4&$1&start=$6 [QSA,L,NC]
# Main feeds & channels
RewriteRule ^forums/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?(/([a-z0-9_-]+))?/([a-z0-9_]+)\.xml(\.gz)?$ /forums/gymrss.php?$9=$8&$2&$4&$6&gzip=$10 [QSA,L,NC]
# Module feeds
RewriteRule ^forums/[a-z0-9_-]*-[a-z]{1,2}([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ /forums/gymrss.php?$8=$1&$3&$5&$7&gzip=$9 [QSA,L,NC]
# Module feeds without ids
RewriteRule ^forums/([a-z0-9_-]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$ /forums/gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9 [QSA,L,NC]
# Google SitemapIndex
RewriteRule ^forums/sitemapindex\.xml(\.gz)?$ /forums/sitemap.php?gzip=$1 [QSA,L,NC]
# Module cat sitemaps
RewriteRule ^forums/[a-z0-9_-]+-([a-z]{1,2})([0-9]+)\.xml(\.gz)?$ /forums/sitemap.php?module_sep=$1&module_sub=$2&gzip=$3 [QSA,L,NC]
# Module sitemaps
RewriteRule ^forums/([a-z0-9_]+)-([a-z0-9_-]+)\.xml(\.gz)?$ /forums/sitemap.php?$1=$2&gzip=$3 [QSA,L,NC]
# END GYM Sitemaps & RSS
#####################################################









# BEGIN wtwp_cache
<IfModule mod_mime.c>

	# Text
	AddType text/css .css
	AddType application/x-javascript .js
	AddType text/html .html .htm
	AddType text/richtext .rtf .rtx
	AddType text/plain .txt
	AddType text/xml .xml

	# Image
	AddType image/gif .gif
	AddType image/x-icon .ico
	AddType image/jpeg .jpg .jpeg .jpe
	AddType image/png .png
	AddType image/svg+xml .svg .svgz

	# Video
	AddType video/asf .asf .asx .wax .wmv .wmx
	AddType video/avi .avi
	AddType video/quicktime .mov .qt
	AddType video/mp4 .mp4 .m4v
	AddType video/mpeg .mpeg .mpg .mpe

	# PDF
	AddType application/pdf .pdf

	# Flash
	AddType application/x-shockwave-flash .swf

	# Font
	AddType application/x-font-ttf .ttf .ttc
	AddType application/vnd.ms-fontobject .eot
	AddType application/x-font-otf .otf

	# Audio
	AddType audio/mpeg .mp3 .m4a
	AddType audio/ogg .ogg
	AddType audio/wav .wav
	AddType audio/wma .wma

	# Zip/Tar
	AddType application/x-tar .tar
	AddType application/x-gzip .gz .gzip
	AddType application/zip .zip
</IfModule>

<IfModule mod_expires.c>
	ExpiresActive On

	# Text
	ExpiresByType text/css A31536000
	ExpiresByType application/x-javascript A31536000
	ExpiresByType text/html A3600
	ExpiresByType text/richtext A3600
	ExpiresByType text/plain A3600
	ExpiresByType text/xml A3600

	# Image
	ExpiresByType image/gif A31536000
	ExpiresByType image/x-icon A31536000
	ExpiresByType image/jpeg A31536000
	ExpiresByType image/png A31536000
	ExpiresByType image/svg+xml A31536000

	# Video
	ExpiresByType video/asf A31536000
	ExpiresByType video/avi A31536000
	ExpiresByType video/quicktime A31536000
	ExpiresByType video/mp4 A31536000
	ExpiresByType video/mpeg A31536000

	# PDF
	ExpiresByType application/pdf A31536000

	# Flash
	ExpiresByType application/x-shockwave-flash A31536000

	# Font
	ExpiresByType application/x-font-ttf A31536000
	ExpiresByType application/vnd.ms-fontobject A31536000
	ExpiresByType application/x-font-otf A31536000

	# Audio
	ExpiresByType audio/mpeg A31536000
	ExpiresByType audio/ogg A31536000
	ExpiresByType audio/wav A31536000
	ExpiresByType audio/wma A31536000

	# Zip/Tar
	ExpiresByType application/x-tar A31536000
	ExpiresByType application/x-gzip A31536000
	ExpiresByType application/zip A31536000
</IfModule>
<FilesMatch "\.(?i:css|js|htm|html|rtf|rtx|txt|xml|gif|ico|jpg|jpeg|jpe|png|svg|svgz|asf|asx|wax|wmv|wmx|avi|mov|qt|mp4|m4v|mpeg|mpg|mpe|pdf|swf|ttf|ttc|eot|otf|mp3|m4a|ogg|wav|wma|tar|gz|gzip|zip)$">
	<IfModule mod_headers.c>
		Header set Pragma "public"
		Header append Cache-Control "public, must-revalidate, proxy-revalidate"
		Header unset ETag
	</IfModule>
</FilesMatch>
<FilesMatch "\.(?i:css|js|gif|ico|jpg|jpeg|jpe|png|pdf|swf|ttf|ttc|eot|otf)$">
    <IfModule mod_headers.c>
		Header unset Set-Cookie
	</IfModule>
</FilesMatch>
# END wtwp_cache

# BEGIN wtwp_security
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /
	RewriteRule ^wp-admin/includes/ - [F,L]
	RewriteRule !^wp-includes/ - [S=3]
	RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
	RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
	RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>
<Files "wp-config.php">
	Order allow,deny
	Deny from all
</Files>
Options -Indexes
# END wtwp_security








# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I have been searching everywhere online for answers. The phpbb-seo website appears to be shut down, so most of the support dealing with this issue is not accessible.
Last edited by stevemaury on Fri Oct 28, 2016 9:14 pm, edited 1 time in total.
Reason: Code tags added so show complete url.

Locked

Return to “[3.1.x] Support Forum”