stanleyb23
Member
I have moved my forum from apache to nginx. It's working great but there's one thing i d like to fix.
My old rewrite rules are not working now. There are still a lot of extarnal links to my forum and they get 404's now.
What's the best way to solve this?
Thanks for your help!!
Ralf
My old rewrite rules are not working now. There are still a lot of extarnal links to my forum and they get 404's now.
What's the best way to solve this?
Thanks for your help!!
Ralf
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
# MattW
RewriteRule ^about([0-9]+)\.html /Forum/topic/$1/ [L,R=301,NC]
RewriteRule ^(.*)\-t([0-9]+)\.html /Forum/topic/$2/ [L,R=301,NC]
RewriteRule ^(.*)\-t([0-9]+)\-([0-9]+)\.html /Forum/topic/$2/ [L,R=301,NC]
RewriteRule ^(.*)\-f([0-9]+)\.html /Forum/forum/$2/ [L,R=301,NC]
RewriteRule ^(.*)\-f([0-9]+)\-([0-9]+)\.html /Forum/forum/$2/ [L,R=301,NC]
RewriteRule ^ntopic([0-9]+)\.html /Forum/topic/$1/ [L,R=301,NC]
RewriteRule ^ptopic([0-9]+)\.html /Forum/topic/$1/ [L,R=301,NC]
RewriteRule ^post([0-9]+)\.html /Forum/posts/$1/ [L,R=301,NC]
RewriteRule ^post\-([0-9]+)\.html /Forum/posts/$1/ [L,R=301,NC]
RewriteRule ^about([0-9]+)\-([0-9)+)\-asc\-([0-9]+).html /Forum/topic/$1/ [L,R=301,NC]
RewriteRule ^posting\.php$ /Forum/? [L,R=301,NC]
# End MattW
RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$) [NC]
RewriteRule rss\.php https://www.klusidee.nl/Forum/topic/%2/ [R=301,L]
RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$) [NC]
RewriteRule ^viewtopic\.php$ /Forum/topic/%2/? [L,R=301,NC]
RewriteCond %{QUERY_STRING} f=(\d+)$ [NC]
RewriteRule ^(viewforum\.php|viewtopic\.php)$ /Forum/forum/%1/? [L,R=301,NC]
RewriteCond %{QUERY_STRING} (^|&)p=([0-9]+)(&|$) [NC]
RewriteRule ^viewtopic\.php$ /Forum/posts/%2/? [L,R=301,NC]
RewriteCond %{QUERY_STRING} u=(\d+)$ [NC]
RewriteRule ^memberlist\.php$ /Forum/members/%1/? [L,R=301,NC]
RewriteCond %{QUERY_STRING} search_author=(.*)$ [NC]
RewriteRule ^search\.php$ /Forum/search/?q=%1 [L,R=301,NC]
RewriteCond %{QUERY_STRING} searchword=(.*)$ [NC]
RewriteRule ^search\.php$ /Forum/search/?q=%1 [L,R=301,NC]
# 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 /Forum
# This line may be needed to workaround HTTP Basic auth issues when using PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
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]