Here am going to explain you how force a website redirect from http to https using htaccess files, we all know htaccess is the configuration files normally using in Apache web server to specify redirect rules.we can write our own URL redirect rules and based on we can change the entire website url structure.
Most common use of URL redirects for SEO purpose and better page readability/simplicity, we have lots of rule for redirecting here am going to explain you reule to redirect from http to https using htaccess files
See below force a website redirect from http to https using htaccess This is full .htaccess to files redirect from http to https
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?tutorialshore\.com
RewriteRule ^(.*)$ https://www.tutorialshore.com/$1 [R,L]
Nowadays many of the website show different title character in google search page ,this is actually done by the hackers, the will replace our original title with Japanese ,Slavic languages, Indo-European languages, East Slavic languages, Balto-Slavic languages any of the languages with our website title this is why google shows the wrong title for my website. Here am going to explain how to remove that hack or spammers and bring back our current title to google search result page.
See below Images google shows the wrong title for my website
How to remove wrong title for my website
Step 1
Open google and search
site:tutorialshore.com japan **replace tutorialshore.com with yourdomain.com
site:tutorialshore.com Slavic
open the pages code, that listing in the google search result and remove any unwanted code if their that may be done my hackers
Step 2
Open your sitemap.xml page and double confirm all the URL listed in the site map are correct URL in the website, if you find anything regenerate sitemap and resubmit to google webmaster
Step 3
Sort Files by date of modified and find out any new files update without your permission
Step 4
check file permission if any having 444 permission delete that files and upload the same files from your backup.
Step 5
Open google webmaster account
report the hacked pages and remove it with the help of google webmaster
Most of the case When you tried to add a slug keyword for page model you will get error NameError: name ‘slugify’ is not defined Django error.Here we are discussing how to solve “NameError: name ‘slugify’ is not defined Django error”
Here is the model
from django.db import models
# Create your models here.
class page(models.Model):
"""Model representing a book (but not a specific copy of a book)."""
page_id = models.AutoField(primary_key=True)
page_title = models.CharField(max_length=200)
author_name = models.CharField(max_length=100)
page_content = models.TextField(max_length=1000, help_text='Enter your page content')
page_name = models.SlugField(editable=False) # hide from admin
def save(self):
if not self.page_id:
self.page_name = slugify(self.page_title)
super(page, self).save()
Here is the error
“NameError: name ‘slugify’ is not defined Django error”
How to Solve it
Step install python-slugify module
# pip install python-slugify
Include slugify module in your model