Forum Moderators: phranque
I need the following to be done :(Already got all DONE for DNS SETUP AND HTTP.DOC setup for this from host)
I am a newbie in php and would appreciate if somebody can explain in PAINT BY NUMBER form : i.e. step explainatory.
my current site is working this way :
www.domain.com/company-name.html
(infact www.domain.com/listing.php?id=2)
www.domain.com/company-name/add-review.html
(infact www.domain.com/listing_add_review.php?id=2)
I want the above thing to be redirected as a subdomain for each company. like :
companyname.domain.com (with no hyphen between company name)
companyname.domain.com/add-review.html
MY HTACCESS LOOKS LIKE THIS :
Options +FollowSymLinks
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteRule ^([a-zA-Z]+)\.html$ $1.php [L]
RewriteRule ^view\.php$ listing.php [L]
#Handle alpha links, using number for page number when results are displayed
RewriteRule ^search-alpha-(.+)-([0-9]+)\.html$ search-alpha.php?letter=$1&page=$2 [L]
#Handle all category links. Static category text followed by ID, followed by path
#The "Category" text here needs to be changed if the language variable category is changed
RewriteRule ^directory\/(.+)/$ index.php?id=$1 [L]
RewriteRule ^directory\/(.+)/([0-9]+)\.html$ index.php?id=$1&page=$2 [L]
#Handle all location links. Static location text followed by ID, followed by path
#The "Location" text here needs to be changed if the language variable location is changed
RewriteRule ^Location\/(.+)/$ index_locations.php?id=$1 [L]
RewriteRule ^Location\/(.+)/([0-9]+)\.html$ index_locations.php?id=$1&page=$2 [L]
#Handle Custom Module Pages
RewriteRule ^view-(.+)\.html$ module_page.php?moduleid=$1 [L]
#Ignore any physical files
#Handle all listing links. Listing ID followed by listing name or corresponding pages.
RewriteRule ^out-([0-9]+)\.html$ listing_out.php?id=$1 [L]
RewriteCond %{REQUEST_URI}!-f
RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^([^/]+)\.html$ listing.php?id=$1 [L]
RewriteRule ^(.+)/gallery\.html$ listing_gallery.php?id=$1 [L]
RewriteRule ^(.+)/send-message\.html$ listing_email.php?id=$1 [L]
RewriteRule ^(.+)/send-message-friend\.html$ listing_email_friend.php?id=$1 [L]
RewriteRule ^(.+)/reviews\.html$ listing_reviews.php?id=$1 [L]
RewriteRule ^(.+)/add-review\.html$ listing_add_review.php?id=$1 [L]
RewriteRule ^(.+)/products-(.+)\.html$ listing_products.php?id=$1&type=$2 [L]
RewriteRule ^(.+)/documents\.html$ listing_documents.php?id=$1 [L]
</IfModule>