By henryhood
How can I redirect from http://www.irhb.org to http://www.irhb.org/w/index.php ? My (Mediawiki-based) site resides in /var/www/html/w .
The makeshift solution I am currently using is to put an index.php file in /var/www/html/ with “header( ‘Location: http://www.irhb.org/w/index.php’ );”, but this clearly isn’t the best solution, and a user who navigates to http://www.irhb.org/ is redirected to http://178.62.31.57/w/index.php/Main_Page instead of to http://www.irhb.org/w/index.php/Main_Page .
I have experimented quite a bit with /etc/apache2/sites-enabled/000-default.conf and putting an .htacces file in /var/www/html/ , but I can’t seem to get it right :-)
I would be grateful for your help.
Henrik
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You can try this .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?rhb.org$
RewriteRule ^(/)?$ w [L]
You must have mod_rewrite enabled under apache service…
Thanks, I did an “a2enmod rewrite”, restarted apache2 and put the .htaccess file you suggest in /var/www/html/, but the browser just shows a directory listing for the document root directory.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.