eagle eyes
Active member
@eagle eyes
Add to top of .htaccess file inside of /gallery:
Rich (BB code):RewriteEngine On RewriteCond %{HTTP_HOST} !^yoursite\.com$ RewriteRule ^(.*)$ http://yoursite.com/gallery/$1 [R=301,L]
It doesn't redirect.
@eagle eyes
Add to top of .htaccess file inside of /gallery:
Rich (BB code):RewriteEngine On RewriteCond %{HTTP_HOST} !^yoursite\.com$ RewriteRule ^(.*)$ http://yoursite.com/gallery/$1 [R=301,L]
It doesn't redirect.
www.defence.pk/gallery/What is your site URL?
Sure enough. The rewrite isn't working.
Maybe it's implemented incorrectly or there is some other context that affects it. I can take a look if you give me FTP access to your server.
Just sent a PC.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^defence\.pk$
RewriteRule ^(.*)$ http://defence.pk/gallery/$1 [R=301,L]
Thanks for this. However I've hit a little snag.
Our old vbulletin URL was .co.uk/forums
Xenforo is installed in the root of our site now, however ..... .co.uk/forums takes us to the XenForo index (.co.uk is the portal).
Therefore if I upload these files to a folder called /forums.....then I can no longer access our forums.
Yup. And therein lies my problem
How do I use these scripts to redirect my old vbulletin links?![]()
Hi @Jake Bunce , did you get anywhere with the redirects?
My archive urls are like this: http://www.v6mustang.com/archive/index.php/t-1495.html
They do not work with the current files.
It works with a ?
http://www.v6mustang.com/archive/index.php?t-1495.html
This probably comes down to a difference in how your web server handles the request, because the archive/index.php script handles both types of URLs. A special rewrite might be needed to properly handle those URLs.
#301 redirect non-www to www
server {
server_name v6mustang.com;
rewrite ^ http://www.v6mustang.com$request_uri? permanent;
}
server {
server_name www.v6mustang.com;
# ngx_pagespeed & ngx_pagespeed handler
include /usr/local/nginx/conf/pagespeed.conf;
include /usr/local/nginx/conf/pagespeedhandler.conf;
include /usr/local/nginx/conf/pagespeedstatslog.conf;
# limit_conn limit_per_ip 16;
# ssi on;
access_log /home/nginx/domains/v6mustang.com/log/access.log combined buffer=32k;
error_log /home/nginx/domains/v6mustang.com/log/error.log;
root /home/nginx/domains/v6mustang.com/public;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$uri&$args;
# block common exploits, sql injections etc
#include /usr/local/nginx/conf/block.conf;
# Enables directory listings when index file not found
#autoindex on;
# Shows file listing times as local time
#autoindex_localtime on;
# Enable for vBulletin usage WITHOUT vbSEO installed
#try_files / /index.php;
}
location /internal_data/ {
internal;
}
location /library/ {
internal;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /vb/ {
rewrite ^/vb/f[\d]+/.+-([\d]+)/index([\d]+).html /vb/showthread.php?t=$1&page=$2 last;
rewrite ^/vb/f[\d]+/.+-([\d]+)/ /vb/showthread.php?t=$1 last;
rewrite ^/vb/f([\d]+)/index([\d]+).html /vb/forumdisplay.php?f=$1&page=$2 last;
rewrite ^/vb/f([\d]+)/ /vb/forumdisplay.php?f=$1 last;
}
include /usr/local/nginx/conf/staticfiles.conf;
include /usr/local/nginx/conf/php.conf;
include /usr/local/nginx/conf/drop.conf;
#include /usr/local/nginx/conf/errorpage.conf;
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.