7 changed files with 127 additions and 56 deletions
@ -1,32 +1,32 @@ |
|||
|
|||
server { |
|||
|
|||
{{#multisite}} |
|||
# Uncomment the following line for domain mapping |
|||
# listen 80 default_server; |
|||
{{/multisite}} |
|||
|
|||
server_name {{site_name}} {{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}; |
|||
|
|||
{{#multisite}} |
|||
# Uncomment the following line for domain mapping |
|||
#server_name_in_redirect off; |
|||
{{/multisite}} |
|||
|
|||
access_log /var/log/nginx/{{site_name}}.access.log {{^static}}rt_cache{{/static}}; |
|||
error_log /var/log/nginx/{{site_name}}.error.log; |
|||
root /var/www/{{site_name}}/htdocs; |
|||
|
|||
index {{^static}}index.php{{/static}} index.html index.htm; |
|||
|
|||
{{#static}} |
|||
location / { |
|||
try_files $uri $uri/ /index.html; |
|||
} |
|||
{{/static}} |
|||
|
|||
{{^static}}include{{/static}} {{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}} |
|||
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}} |
|||
{{#wp}}include common/wpcommon.conf;{{/wp}} |
|||
include common/locations.conf; |
|||
{{#multisite}} |
|||
# Uncomment the following line for domain mapping |
|||
# listen 80 default_server; |
|||
{{/multisite}} |
|||
|
|||
server_name {{site_name}} {{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}; |
|||
|
|||
{{#multisite}} |
|||
# Uncomment the following line for domain mapping |
|||
#server_name_in_redirect off; |
|||
{{/multisite}} |
|||
|
|||
access_log /var/log/nginx/{{site_name}}.access.log {{^static}}rt_cache{{/static}}; |
|||
error_log /var/log/nginx/{{site_name}}.error.log; |
|||
root /var/www/{{site_name}}/htdocs; |
|||
|
|||
index {{^static}}index.php{{/static}} index.html index.htm; |
|||
|
|||
{{#static}} |
|||
location / { |
|||
try_files $uri $uri/ /index.html; |
|||
} |
|||
{{/static}} |
|||
|
|||
{{^static}}include{{/static}} {{#basic}}common/php.conf;{{/basic}}{{#w3tc}}common/w3tc.conf;{{/w3tc}}{{#wpfc}}common/wpfc.conf;{{/wpfc}} {{#wpsc}}common/wpsc.conf;{{/wpsc}} |
|||
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}} |
|||
{{#wp}}include common/wpcommon.conf;{{/wp}} |
|||
include common/locations.conf; |
|||
} |
|||
|
@ -0,0 +1,20 @@ |
|||
from urllib.parse import urlparse |
|||
|
|||
|
|||
def validate_domain(url): |
|||
|
|||
# Check if http:// or https:// present remove it if present |
|||
domain_name = url.split('/') |
|||
if 'http:' in domain_name or 'https:' in domain_name: |
|||
domain_name = domain_name[2] |
|||
else: |
|||
domain_name = domain_name[0] |
|||
|
|||
www_domain_name = domain_name.split('.') |
|||
final_domain = '' |
|||
if www_domain_name[0] == 'www': |
|||
final_domain = '.'.join(www_domain_name[1:]) |
|||
return final_domain |
|||
else: |
|||
final_domain = domain_name |
|||
return final_domain |
Loading…
Reference in new issue