Good morning everyone, the problem is
Website, there are two level domain name, now can be normal access, but not with the WWW but access to level two went,
The following is the. htaccess code
Rewriteengine on
Rewritebase/
Rewritecond%{http_host} ^www.518visa.net$
Rewritecond%{request_uri}!^/
Rewritecond%{request_filename}!-f
Rewritecond%{request_filename}!-d
Rewriterule ^ (. *) $/$1
Rewritecond%{http_host} ^www.518visa.net$
Rewriterule ^ (/)? $/[L]
#以下为二级, if there is a simpler hope to teach, thank you
Rewritecond%{http_host} ^ ([a-za-z]*[^www\b]). 518visa.net$
Rewritecond%{request_uri}!^visalist/
Rewritecond%{request_filename}!-f
Rewritecond%{request_filename}!-d
Rewritecond%{http_host} ^ ([a-za-z]*[^www\b]). 518visa.net$
Rewriterule ^ ([1-9]\d*). HTML ($) visalist/visa_detail.php?id=$1
Rewriterule ^ (/)? $ visalist/[L]
URL for www.518visa.net, non-external chain ads, trouble to see, thank you.
Red box selected, click to go to the level two domain name
What I need now is to go directly to band www without www access, such as abc.com/a.html go to www.abc.com/a.html, I used the
Rewritecond%{http_host}!^www.518visa.net$ [NC]
Rewriterule ^ (. *) $ http://www.518visa.net/$1 [l,r=301]
Not even this one.
Thank you, online and so on.
Reply to discussion (solution)
I use the following:
#301RewriteCond%{http_host} ^xxx.net [Nc]rewriterule ^ (. *) $ http://www.xxx.net/$1 [l,r=301] #aaaa. Xxx.net-is Okrewritecond%{http_host} (?! WWW|WW) ^[a-z0-9\-]+.xxx.net$rewriterule ^/?$/%{http_host}rewriterule ^/([a-z0-9\-]+). xxx.net$ /1.php?keyword =$1
If not, look at what your Apache DocumentRoot set up.
If not, you can consider using the alternative.
Build a xxx.net web and then make a htaccess in this web 301 to www