Permalinks Messed up

After hours of searching and reading,
This is how I solved the Problem.

Step 1: Create a .htaccess file in the root folder and put this code there.

# BEGIN
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END 

Step 2: is Mentioned here

enter image description here