View Full Version : Apache server question
GSbiker
08-07-2010, 01:04 PM
This is probably a easy question but I just can't figure it out. I run Apache on a in-house Windows box. My url is www.thewirelessregister.com. When that url is accessed it goes to a splash page with a link to www.thewirelessregister.com/fourms/.
How do I configure Apache to go directly to the forum when www.thewirelessregister.com is entered in the browser? It's probably something in the vhosts.conf file.
Any help would be appreciated.
snakes1100
08-07-2010, 02:24 PM
Add a .htaccess file to your root/www folder with this in it, that assumes you have mod_rewrite configured into apache.
RewriteEngine on
rewritecond %{http_host} ^thewirelessregister.com [nc]
rewriterule ^(.*)$ http://www.thewirelessregister.com/forums/$1 [r=301,nc]
Angel-Wings
08-07-2010, 06:37 PM
Or just move the forum directory one level down. Then you can disable .htaccess to have some speed-up.
If you don't want or can move the files, maybe better do it directly in the Vhost configuration that you again disable .htaccess parsing
Boofo
08-07-2010, 08:02 PM
Make a file called index.php in your domain root with the following content:
<?php header('Location: http://www.thewirelessregister.com/fourms/'); ?>
GSbiker
08-08-2010, 08:12 PM
Make a file called index.php in your domain root with the following content:
<?php header('Location: http://www.thewirelessregister.com/fourms/'); ?>
Perfect. Thanks. :up:
Really worked good when I spelled forums correctly. :D
Boofo
08-08-2010, 08:18 PM
Perfect. Thanks. :up:
Really worked good when I spelled forums correctly. :D
I have used that method for years. ;)
Marco van Herwaarden
08-09-2010, 04:07 AM
It is not a method you should use on a busy site, as it will have a negative impact on performance.
Boofo
08-09-2010, 04:14 AM
That is the first time I have ever heard that said about doing it that way. How so?
Marco van Herwaarden
08-09-2010, 04:15 AM
Because it will have 2 pageloads.
Boofo
08-09-2010, 06:17 AM
Perfect. Thanks. :up:
Really worked good when I spelled forums correctly. :D
Sorry about that. My keebord kant spel, it seams. ;)
BSMedia
08-11-2010, 03:18 AM
Because it will have 2 pageloads.
Would a 301 redirect work better?
Marco van Herwaarden
08-11-2010, 06:55 AM
I am not an expert on this, but i think the order based on performance is:
- Webserver config.
- .htaccess
- Page redirect
Angel-Wings
08-15-2010, 09:51 AM
- Webserver config.
- .htaccess
- Page redirect
Doesn't matter much. If it's configured in the Webserver but still AllowOverride is set Apache will still look for .htaccess.
For - for VB fastest would be something like:
<Directory /where/ever/vb/is/installed>
AllowOverride None
Options None
...
</Directory>
Then setting a redirect via mod_rewrite or some META redirect via a small HTML page from the old location. :)
Boofo
08-15-2010, 11:44 AM
Doesn't matter much. If it's configured in the Webserver but still AllowOverride is set Apache will still look for .htaccess.
For - for VB fastest would be something like:
Then setting a redirect via mod_rewrite or some META redirect via a small HTML page from the old location. :)
But wouldn't that make the .htaccess moot then?
Nano_
08-29-2010, 03:30 PM
httpd-vhost.conf (or just vhost.conf):
<VirtualHost YOUR.IP.HERE:80>
DocumentRoot /direct/folder/to/your/forum
ServerName forum.yourdomain.com
ServerAdmin admin@yourdomain.com
ScriptAlias "/cgi-bin/" "/direct/folder/to/your/forum/cgi-bin/"
ServerAlias www.yourdomain.com forum.yourdomain.com anything.yourdomain.com
ErrorLog logs/www-error.log
Options ExecCGI Indexes FollowSymLinks
</VirtualHost>
Save, restart apache using ./apachetcl -k graceful (or any command to restart apache (http://httpd.apache.org/docs/2.0/stopping.html)).
GSbiker
08-29-2010, 04:08 PM
Thanks....I will give it a try. :up:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.