Forum Moderators: phranque
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^board-([0-9]+).html$ board.php?boardid=$1
RewriteRule ^thread-([0-9]+).html$ thread.php?threadid=$1
RewriteRule ^\.htaccess$ - [F]
i have a forum, which is in a folder called forum.
if i open a page, which should be generated by the mod_rewrite rule, like
www.mydomain.com/forum/board-22.html,
it is working.
now i have set some subdomains in apache, which DocumentRoot is set to the forum folder.
when i try to open forum.mydomain.com/board-22.html
i get an error message, the 404.
anybody knows a solution for that?
i hope i was clear with explaining
Welcome to WebmasterWorld!
The first thing to check is your server error log. Find out where the request is being rewritten to. It may be rewritten to the wrong directory.
If so, you may be able to solve it by 'rooting' your substitution URL-path, for example:
RewriteRule ^board-([0-9]+).html$ [b]/b[/b]oard.php?boardid=$1
This is a guess, because I can't see your directory structure and server config. But your server error log will probably give you a very good idea of what the problem is.
Jim
first, here is my config.
i have one directory, where all HTML files are in
/home/webadmin/cai-gaming.com/html
there is another folder for the forum
/home/webadmin/cai-gaming.com/html/forum
then i have added some vhosts to my httpd.conf
<VirtualHost 212.18.254.75:80>
<Directory /home/webadmin/forum.cai-gaming.com/html>
Options Indexes Includes FollowSymLinks
AllowOverride All
</Directory>
ServerName forum.cai-gaming.com
DocumentRoot /home/webadmin/cai-gaming.com/html/forum
SuexecUserGroup webadmin webadmin
ServerAdmin "admin@cai-gaming.com"
ScriptAlias "/cgi-bin/" "/home/webadmin/forum.cai-gaming.com/cgi-bin/"
CustomLog "/home/webadmin/forum.cai-gaming.com/access_log" "combined"
ErrorLog "/home/webadmin/forum.cai-gaming.com/error_log"
</VirtualHost>
I can access the forum from [cai-gaming.com...] and [forum.cai-gaming.com,...] and all files in it.
I can use the rewrite in [cai-gaming.com...]
This is working fine.
But not from [forum.cai-gaming.com...]
i have no clue why it isn't working.
here are the logfiles
access_log
195.212.29.67 - - [22/Feb/2005:09:10:53 +0000] "GET /board-22.html HTTP/1.1" 404 298 "-" "Mozilla/5.0 (Windows
; U; Windows NT 5.0; en-GB; rv:1.7.5) Gecko/20041110 Firefox/1.0"
195.212.29.67 - - [22/Feb/2005:09:11:00 +0000] "GET /.htaccess HTTP/1.1" 403 298 "-" "Mozilla/5.0 (Windows; U;
Windows NT 5.0; en-GB; rv:1.7.5) Gecko/20041110 Firefox/1.0"
error_log
[Tue Feb 22 09:10:53 2005] [error] [client 195.212.29.67] File does not exist: /home/webadmin/cai-gaming.com/html/forum/board-22.html
[Tue Feb 22 09:11:00 2005] [error] [client 195.212.29.67] client denied by server configuration: /home/webadmi
n/cai-gaming.com/html/forum/.htaccess
tough question?
maybe something wrong with the httpd.conf?