I'm wondering which
.htaccess
file it should go in. I see in the Xenforo
upload
folder there is an
.htaccess
and an
htaccess.txt
in the
upload
folder. What is the .txt for? The contents of both files are identical.
The guide I followed had me run these commands to move both the files and hidden files when I first uploaded and installed Xenforo:
mv upload/* .
mv upload/*. .
And it resulted in an error, which the person said to ignore because it always happens.
But now when I look at my
public
folder there is no
.htaccess
, only
htaccess.txt
.
There are other
.htaccess
files at:
/home/nginx/domains/forum.mysite.com/public/src/.htaccess
/home/nginx/domains/forum.mysite.com/public/internal_data/.htaccess
/home/nginx/domains/forum.mysite.com/public/library/.htaccess
Do I need to upload the
.htaccess
to the
public
folder? If so, I'm worried that other important files also didn't copy.
The default content of Xenforo's base .htaccess file is:
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
# 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 workaround HTTP Basic auth issues when using 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>
Would I just add a standard rewrite rule at the end? IE:
Code:
# This line may be needed to workaround HTTP Basic auth issues when using 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>
Redirect 301 /threads/.47/ /threads/.68/
I also found this thread
https://xenforo.com/community/threads/redirecting-thread-urls.168090/#post-1364839 that showed an example using the
route filter. In
find route
could I put
/threads/.47/
and
replace with
put
/threads/.68/
?
EDIT: The route filter code didn't work.
https://forum.mysite.com/threads/full-thread-url.47/
is the "oops not found" page.
https://forum.mysite.com/threads/.47/
gives me
403 Forbidden nginx
.
EDIT:
Well I found a way to do it with
Centmin Mod:
Centmin Mod redirects:
www.youtube.com/watch?v=tEwliqSt1Zg&t=8m2s
/usr/local/nginx/conf/conf.d/redirects.conf
Code:
map $request_uri $redirect_uri {
/threads/47/ /threads/59/;
/threads/long-url.47/ /threads/long-url.59/;
}
You DO have to do
ngxrestart
each time. And you have to put both the long AND short URLs.
For some reason
/threads/.47/
does not work. There has to be at least one (random) character before the period. IE:
/threads/t.47/
.