mod_rewrite sahforum to sahforum2 |
Fri, 03 May 2013 16:41 |
|
|
With the new forum the URL changes from
* http://starsautohost.org/sahforum/...
to
* http://starsautohost.org/sahforum2/...
And it looks like it will stay this way (for ever or still a while).
Unfortunately this breaks all old links to forum posts. The old hands will just add the "2" to the old URL but new users will go amiss.
A way to solve this would be to redirect all old URLs to the new place. This should be rather easily done in the .htaccess file with "mod_rewrite". Well, somehow "easily" because while I know it can be done easily, I nevertheless would need to dive into the exact how-to first. But I am sure that we have enough people here who can write the code line(s) within 5min.
@Ron, wouldn't that be an intersting solution?
Can anybody spell out the code line which needs to be added to the htaccess file?
Report message to a moderator
|
|
|
|
|
Re: mod_rewrite sahforum to sahforum2 |
Tue, 30 July 2013 11:09 |
|
|
Ok, I've looked it up and it is, indeed, very simple.
At the moment all forum posts are available and accessable at
* http://starsautohost.org/sahforum2/...
To fix all (broken) URLs linking to the old forum we just need the following 2 lines:
code for .htaccess to redicrect /sahforum to /sahforum2RewriteEngine on
Redirect /sahforum http://starsautohost.org/sahforum2
With those 2 lines every link to the old forum gets automatically redirected to the new temporary forum.
In the base directory of http://starsautohost.org/ there is probably a file called ".htaccess". Just place the above 2 lines into it and upload it. If there is no file called ".htaccess", just create one.
Ron wrote on Fri, 26 July 2013 04:32Sigh, was supposed to be temporary. There is one more minor upgrade to the forum software that I need to do, but it's been a year already... The URL change was to help preserve a backup of the older version of the forum files and database if needed.
If you are done with that, we'll have the problem that all new links to /sahforum2 get broken. We can solve this as easily as before. Just replace the above 2 lines with the following:
code for .htaccess to redicrect /sahforum2 to /sahforumRewriteEngine on
Redirect permanent /sahforum2 http://starsautohost.org/sahforum
This way all links are working at all times, wether they use /sahforum or sahforum2.
An explanation how to use redirect can be found at:
* https://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirec t
Report message to a moderator
|
|
|
|
|