เปลี่ยน subdomain name เป็น path htaccess - subdomain as $_GET parameter


หน้าแรก SEO เปลี่ยน subdomain name เป็น path htaccess - subdomain as $_GET parameter
เปลี่ยน subdomain name เป็น path



  Code
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www). [NC]
RewriteCond %{HTTP_HOST} ^(.*).(.*).com [NC]
RewriteRule (.*) http://www.%2.com/?name=%1 [R=301,L]



rewrites http://subdomain.domain.com to http://www.domain.com/?name=subdomain

to combine the two try something like this


  Code
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} !^(www). [NC]
RewriteCond %{HTTP_HOST} ^(.*).(.*).com [NC]
RewriteRule (.*) http://www.%2.com/index.php?route=$1&name=%1 [R=301,L]



that will redirect http://subdomain.domain.com/hello-world to http://www.domain.com/index.php?route=hello-world&name=subdomain


http://stackoverflow.com/questions/9551603/htaccess-subdomain-as-get-parameter

ขึ้นไปด้านบน