Forum Moderators: phranque

Message Too Old, No Replies

Why don work sub domains by mod rewrite?

         

gurubuy

11:45 am on Sep 12, 2005 (gmt 0)

10+ Year Member



I try make auto sub domains
used this code
# Rewrite subdomain requests to subdirectories except for www.example.com
RewriteEngine On
RewriteCond %{REQUEST_URI}!^/sd_
RewriteCond %{HTTP_HOST}!^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com
RewriteRule (.*) /sd_%1/$1 [L]
#
# Redirect direct user-agent requests for www.example.com/sd_<subdomain>/<page> to [<subdomain>.example.com...]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /sd_(.+)\ HTTP/
RewriteRule ^sd_([^/]+)/(.*)$ [$1.example.com...] [R=301,L]

but apache get 404
btw ...
option in .conf + LoadModule rewrite_module modules/mod_rewrite.so
+ UseCanonicalName Off

what me do?

jdMorgan

1:10 am on Sep 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tested with a simple rewrite rule to make sure that mod_rewrite is available and working on your server?

You may need to add


Options +FollowSymLinks

if not already enabled in your httpd.conf file.

Jim

gurubuy

9:02 am on Sep 13, 2005 (gmt 0)

10+ Year Member



don't work :(
i don't understand why ....