Tag Archives: Wordpress

[resolved] Cannot access /wp-admin or any other page after upgrade to 3.0 (23 posts)

If you are having the redirection loop problem while trying to access wp-admin then try this fix.

change the permission of wp-admin/index.php to 755.

If you have cpanel access then browse to file manager then browse to wp-admin. Then right click on index.php and then change permission and then uncheck Write checkbox

Right click index.php
Right click index.php

Change permission as shown in image below.
Change permissions

Save the changes, you have made and retry to access the wp-admin.

If this doesn’t work for you then you have to look for error_log file in the root of your public_html that should point you to the correct direction in solving this issue.

[How To] Update .htaccess file manually

First of all you might wonder why there is period before the filename. In linux every file that begins with period are taken as hidden files and since .htaccess file is secret file it is hidden from everyone, as it seems to be. There’s nothing special on this.  Here I am going to write some ways of preventing direct access of files/folder by people in internet. I assume you have some experiences in cPanel. A little knowledge of cPanel would do. Now let’s get to the point.

There are times when you need to block some directories from direct access like

http://www.yourdomainname/{secretdirectory}

There are different ways of achieving this, Solutions such as

  • Using Cpanel → Password protect directories
  • Using  Cpanel → Create redirection
  • Upload blank index.htm (not so effective) to the directory you want to not have directory listing.

The solutions above ultimately create the .htaccess file which are put to the root directory of each directory which have some rule on them.

So, in .htaccess file we define some rule that tells the server to route the request for the particular url to some other urls relative to some base url. It’s same like changing the flow of water by using some pipes. Isn’t that simple ?

Sample .htaccess file contents

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

For References on Apache mod_rewrite.c, See the links below :
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
http://www.askapache.com/htaccess/

I am going to use the same mod_rewrite.c contents, that I have on my .htaccess file. You can use the same content if you want. This was the content generated by the wordpress plugin permalink. For this your server needs to have mod_rewrite.c enabled. Usually all servers have this enabled. If not you need to ask your web hosting provider.

Ok, you have .htaccess file. Now simply upload this file to the root of your website.

For example,

My domain name is http://www.samundra.com.np /public_html/
then I will upload .htaccess →  /public_html/{.htaccess}

So, the final url looks like http://www.samundra.com.np/.htaccess

Now, the last step remains to check if everything was setup as expected.

Create a simple post (test post ) on wordpress that should generate a nice permalink, just try to visit that url, if it works, you have everything working, if not you missed something.

Disadvantages of using Permalinks

Remember if you were to replicate the same wordpress contents to another site, then you’ll have to repeat all these steps on that server. If you forget to put .htaccess file to the root, which in most cases people forget to do, then all the url links are broken and you’ll get 404 Page Not Found error. So it’s always best to keep the .htaccess file and keep backup of it.

Correct me If I wrote something wrong or misguided people after all I am also a human being. Comments and feedbacks are always welcome.

Hope this explanation would be helpful to my friends.

Make Your WordPress Site Search Engine Friendly

Making site search engine friendly makes search engines find your url easy and index it nicely, so it makes them easy to crawl your site.

  1. First Login to your site.
  2. Under Settings Click in Permalinks
  3. Then Under Custom Settings Choose Custom Settings

Then enter

/%post_name%/%post_id%/

You can find more custom tags in wordpress site Find More Custom Tag Here

  1. Then download Permalink Redirector Plugins and install it. Then Activate it.
  2. Now You have successfully changed the url link to Search Engine Friendly. Congratulations.

Before Optimization

http://www.asee.com.np/?p=123

After Optimization

http://www.asee.com.np/123/

Optional Steps

Copy the code generated by wordpress for use in .htaccess file.

If you find that after following the steps above your links are not changed, then your .htaccess file has to be updated manually. [ Teach Me How ]