JatinGupta40 / blog

0 stars 1 forks source link

htaccess - cleanurl #13

Open JatinGupta40 opened 3 years ago

JatinGupta40 commented 3 years ago

Requirements -

  1. Need to clean-up the URLs, not only to remove the .PHP extension from the URL, but also to provide page relevant URL to the respected page.
  2. If an anonymous user(not registered or not logged-in) tries to enter the page that is to be shown to the logged-in user only via URL link, the user should get an error page for that.
  3. For the above-mentioned problem we need to add custom htaccess file for 404 errors.
  4. On the article page, the id and heading of the topic must be shown only with hiphen(-) inside it.
JatinGupta40 commented 3 years ago

Implementation ;

  1. Add the htaccess methods -
    • For removing the .PHP extension from the URL.
    • For adding the 404 error when run with .PHP extension.
    • For removing the ? and & from the article, editblog and delete page.
  2. Change the path from all the places where path is defined.
  3. Removed the .PHP extension from the paths.
  4. Add a custom 404error page for restricting the anonymous user to view the personal details of the user