Today, the PHP version of the server is upgraded to 5.4.4. Then, a previous project is switched to Apache, and the dynamic second-level switch is switched to. htcaccess for sharing.
Authname "yousite website coming soon... "// if you want to give your website a permission to access authtype basic authuserfile D:/XXX /. htpasswd # how to generate a password for access. htpasswd can access the http://www.htaccesstools.com/htpasswd-generator/#AuthGroupFile/dev/null require valid-user <ifmodule mod_rewrite.c> rewriteengine on rewritebase/# removes access to the system folder by users. # Additionally this will allow you to create a system. PHP controller, # pre Viously this wocould not have been possible. # 'system' can be replaced if you have renamed your system folder. rewritecond % {request_uri} ^ system. * rewriterule ^ (. *) $/index. PHP? /$1 [l] # When your application folder isn't in the system folder # this snippet prevents user access to the application folder # submitted: fabdrol # rename 'application' to your Applications folder name. rewritecond % {request_uri} ^ application. * rewriterule ^ (. *) $/index. PHP? /$1 [l] <ifmodule mod_proxy.c> # redirect to boutique (with any trailing path) rewritecond % {http_host }! ^ Www. [Nc] rewritecond % {http_host} ^ ([^.] +) .yousite.com (. *) $ [Nc] rewriterule ^ (. *) $ http://www.yousite.com/boutique/42511042 [P, L] </ifmodule> <ifmodule! Mod_proxy.c> # redirect to boutique (with any trailing path) rewritecond % {http_host }! ^ Www. [Nc] rewritecond % {http_host} ^ ([^.] +) .yousite.com (. *) $ [Nc] rewriterule ^ (. *) $ response [R = 301, l] </ifmodule> # Otherwise, force WWW; rewritecond % {http_host} ^ yousite.com $ [Nc] rewriterule ^ (. *) $ http://www.yousite.com/#1 [R = 301, l] # checks to see if the user is attempting to access a valid file, # such as an image or CSS document, if this isn' t true it sends # Request to index. php rewritecond % {request_filename }! -F rewritecond % {request_filename }! -D rewriterule ^ (. *) $ index. php/$1 [l] </ifmodule> <ifmodule! Mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's # can be sent to index. PHP, And everything works as normal. # submitted by: elliothaughin errordocument 404/index. php </ifmodule>