Forum Moderators: phranque
http://2072.landsale.lk/fsdfsdfsdfsd.php
http://2072.landsale.lk/fsdfsdfsdfdsfsdfsdfsdrwerwefsd.php
http://2072.landsale.lk/fsdf432423423b5234234v23423sdfsdfsd.php
http://2072.landsale.lk/fsdfsdfsdfsd.html
http://2072.landsale.lk/fsdfsdfdas3423423sdfsd.php
RewriteCond %{HTTP_HOST} ^www\.landsale.lk
RewriteCond %{QUERY_STRING} ^name=(.*)$
RewriteRule .* http://%1.landsale.lk? [R=301,L]
#
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
#
RewriteCond %{HTTP_HOST} !^www\.landsale.lk
RewriteCond %{HTTP_HOST} ([^.]+)\.landsale.lk
RewriteRule ^(.*)$ /mydanweem\.php?name=%1 [L]
[edited by: jdMorgan at 2:31 pm (utc) on Aug 10, 2010]
[edit reason] Formatting for readability [/edit]
# Externally redirect direct client requests for /mydanweem.php script URL to "user" subdmomain URL
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /mydanweem\.php\?([^&#\ ]&)*name=([^&#\ ]+)[^\ ]*\ HTTP/
RewriteRule ^mydanweem\.php$ http://%2.landsale.lk/? [R=301,L]
#
# Internally rewrite subdomain URL requests to the /mydanweem.php script
# filepath with "name=" query string, unless this has already been done
RewriteCond %{HTTP_HOST} !^www\.landsale\.lk [NC]
RewriteCond %{HTTP_HOST} ^([^.]+)\.landsale\.lk
RewriteRule !^mydanweem\.php$ /mydanweem\.php?name=%1 [L]
[edited by: jdMorgan at 4:52 pm (utc) on Aug 12, 2010]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /mybrowse\.php\?([^&#\ ]&)*name=([^&#\ ]+)[^\ ]&fatherID=([^&#\ ]+)[^\ ]*\ HTTP/
RewriteRule ^mybrowse\.php$ http://%1.sriauto.com/sri-lanka-classifieds-%2\.html? [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /mybrowse\.php\?([^&#\ ]&)*name=([^&]+)&fatherID=([^&#\ ]+)[^\ ]*\ HTTP/
RewriteRule ^mybrowse\.php$ http://%1.sriauto.com/sri-lanka-classifieds-%2\.html? [R=301,L]