Would phpBB break if I move it from one folder to another? Can I use mod_rewrite to redirect requests for that forum from old folder to new one?

Would phpBB break if I move it from one folder to another? Can I use mod_rewrite to redirect requests for that forum from old folder to new one? - .htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, mod-rewrite, phpbb, .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :


Please note that I have installed dynamic web pages (PHP) in the directory *public_html/old/* in order to create the web site www.example.com. Actually I have created a PHPBB forum and thus the URL of a topic is:



http:// www.example.com/old/viewtopic.php



or the URL of the index file is:



http:// www.example.com/old/index.php



What I would like to do is to change the name of directory “old” to “new”. I have been consulted that it can be done by editing the file .htaccess that exists in the directory *public_html* and write inside:



Redirect permanent /old http://example.com/new


Could you please let me know if is this correct or should I write
www.example.com instead of example.com. Moreover could you please let me know whether this effects any aspect of my web site?



In addition I have been informed that if I change the name of the directory then it may break my web site (since I will have changed the path or location of the script) unless I configure it to work correctly. Could you please let me know what should the configurations be?


Solution :

From the phpBB documentation if you move the directory in which it is installed you may need to change the SCRIPT PATH as defined in the configuration file. It looks like you will only need to do this if you also have the FORCE SERVER URL SETTINGS option set, otherwise phpBB adapts to whatever directory you have it in.



Your redirect code looks correct. As you note, you may want to add a www into it. If your preferred URL is with the "www", then use it in the redirect.


Additionally, if you would like to do some further testing, give the htaccess tester tool a try. It allows you to specify a certain URL as well as the rules you would like to include and then shows which rules were tested, which ones met the criteria, and which ones were executed.

Comments

Popular posts from this blog

Rewrite in Mediawiki, remove index.php, .htaccess

.htaccess rewrite wildcard folder paths from host

Using .htaccess to set a cookie and 301 redirect