Member Avatar for diafol

Hi all, I have a phpbb forum that I had to move to a subdirectory (/forum/). We've been going for 8 years so have a lot of stuff indexed on Google etc.

Is there a painless way of using .htaccess to send all requests to the subdirectory. The root directory will be empty save for the forum subdirectory and its contents.

I have searched various forums, including this one and the Apache site, but am totally out of my depth here - regex kills me!

Any advice would be very welcome.

Recommended Answers

All 3 Replies

Hello,

You should be able to simply change the document root in the apache configuration to the new location.

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com/forum
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
Member Avatar for diafol

Unfortunately, I'm hosted on a shared server.

Member Avatar for diafol

Seems I've got to change to document root in the conf file. Pah! Never mind, job for the host.

Thanks rch. Problem solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.