I have been struggling with .htaccess file to make the URL’s of my site pretty for the past 2 days but nothing seems to work for me. I have watch many videos and follow tutorials still the problem is not solve, bellow are the problem am facing:
The site: yprince9jablog.epizy.com have the following links:
/index.php, /about.php, /contact.php
/categor.php?Id=1
/single.php?Id=1
Problem 1:
For index, about & contact.php I could easily use this. RewriteRule ^home /index.php rule to rewrite eg. domain/index.php to domain/home
What I aspect after this was to see domain/home at the address bar whenever I load the domain but it still shows domain/index.php but when I load domain/home it also works as index.php.
To solve this issue, I need a Rule that will be rewriting domain/index.php to domain/home permanently without having to load domain/home manually or differently.
Problem 2:
Issue 1:
Category.php use id to differentiate the categories available. Since /category.php?Id=1 display the category with the title of News, I want to rewrite /category.php?Id=1 to category/News and when the Id=2 it display the category with the title of Entertainment, so I need the rule to be applied to all id’s without having to rewrite rule for every id.
Issue 2:
Single.php display every single post from the site. Google was able to index single.php but not the links that hold the id. e.g /single.php?Id=2 display a post with the title “Benefits of livig in this world”. Single.php hold the links to all this post that are differentiated with id but Google was not able to index even one of this post links.
So, if /single.php?Id=2 display a post with the title “Benefits of livig in this world”. I need a rule that will rewrite and display /single.php?Id=2 permanently to either:
/single/the-Id/
/Blogs/each-post-title/ (recommended)
/Blogs/the-id/each-post-title/
/category-title/each-post-title/ (highly recommended)
And also it should be applied to all post id 's available under single.php and for the id of any post that will be posted later in single.php.
The last issue here is, Sitemap generators crawl only the index.php page. post links are not crawled. Google was not able to index the site domain: yprince9jablog.epizy.com for almost 2 months now and when I submit sitemap of this site Google console said it’s HTML but my other domains from other providers have same site files with this site and are all indexed except for the single.php links with id’s. I don’t know what is blocking Google from indexing this site.