Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite not working on my server

help please

         

paaull

2:08 pm on Aug 9, 2009 (gmt 0)

10+ Year Member



Why could not run mod_rewrite to create subdomains?

I read all the explanations of the Apache Web Server and not running to create virtual subdomains.

Sorry for my English

jdMorgan

2:29 pm on Aug 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not enough information here to get a useful answer.

What code did you test with?

Where was it located? (.htaccess, httpd.conf, other?)

What URL did you request to test this code?

Did you enable mod_rewrite and start the RewriteEngine (Using the "Options" and "RewriteEngine on" directives?)

Does a simple mod_rewrite function such as the following work?

 RewriteRule ^/?foo\.html$ http://www.webmasterworld.com/? [R=302,L] 

Have you declared your subdomains in your DNS settings and server configuration -- either specifically or using a wild-card?

Jim

paaull

5:59 pm on Aug 9, 2009 (gmt 0)

10+ Year Member



.htaccess is in root folder public_html. I want to make a special blog, and access URL [paul.mysite.com...] display [mysite.com...] content.

But how declare my subdomains in DNS settings and in server configuration?

thanks you,

jdMorgan

6:50 pm on Aug 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In your DNS Zone file editor, add an "A Record" with the subdomain stated explicitly or as a wild-card, and point that entry to the IP address of your server.

On your server, add mod_rewrite code to check for the "paul" subdomain in the environment variable %{HTTP_HOST} and internally rewrite those requests to your script with "paul" as the user= value in the query string.

This will only work if either:
A) You have a unique IP address for your domain and/or you are on an IP-based shared virtual server.
-or-
B) You have used your control panel to declare "paul" as an "add-on domain" and have pointed that add-on domain to the same filespace as your main domain.
-or-
C) You have have used your control panel to declare "paul" as an "add-on domain" and a copy of the index.php script appears in the filespace assigned by the control panel for that add-on domain.

Jim