Recently I installed phplinkdirectory(phpLD) on my free web directory OwnHost.in and ran into issue with SEF URL’s (Search Engine Friendly URL’s). Each time I would enable SEF, except home page, every link except external links would throw Internal Server Error 500, with a generic message to contact site admin. A quick look on the forum indicated that I need to enable .htaccess file in the root folder of installed directory.
Quick ftp to server, uploaded .htaccess with changes I wanted and the result was a bit frustrating since the error 500 decided to show it’s face to me on every refresh.
Google Search led me to believe that GoDaddy and .htaccess doesn’t work are considered synonyms. If you too feel that the statement is true, please think again, since that perception is WRONG, and I can prove it to you with a live example of phpLD v2.1.2 running successfully on http://www.ownhost.in hosted on my own servers @ pubdomains.com which in turn is a GoDaddy Reseller account.
Achieving the results was not easy, I admit since this was the first time for me to test mod_rewrite features, and also because GoDaddy servers have a peculiar behaviour — that of recognizing NEW .htaccess file in 30 – 60 minutes period. What this essentially means is that if you didn’t have .htaccess file on your server, and have uploaded or created one for the first time, please wait for a little while for server to recognize existence of this .htaccess file. 30 – 60 minutes, because a process keeps checking if .htaccess has been created and this checking process starts every 60 minutes, so depending upon when you upload or create new .htaccess file and when the server process starts your .htaccess file would be ready for use. Not bad eh for low cost economy hosting solution!!!
Changes to existing .htaccess are instantaneous Once .htaccess has been registered (and that as I mentioned above is one time process when you create it or upload it for the first time), any subsequent changes reflect immediately. One of the common fallacy I noticed while reading posts on various blogs and forums is that each change requires you to wait for 30 to 60 minutes. In fact one gentleman even put the time to wait as 24 to 48 hours. However, the truth is that for existing .htaccess files any subsequent changes take effect immediately.
If you would like to verify this, simply create a RewriteRule shown below to redirect any request with file extension html to take you to your sites homepage as shown below(Assuming you already have .htaccess available in your root folder, ie if your site is in folder htdocs, .htaccess should be in htdocs, if file is in htdocs/folder, then .htaccess should exist in htdocs/folder)
RewriteEngine On
RewriteBase /
RewriteRule ^(.*).html$ http://www.ownhost.in
Save the file, upload and verify the result by typing http://www.yoursite.com/test.html which should redirect you to http://www.ownhost.in
Once you get this working, change http://www.ownhost.in to http://www.google.com as shown below
RewriteEngine On
RewriteBase /
RewriteRule ^(.*).html$ http://www.google.com
and the moment you save the file in your working directory (on the web server) and test it, you would notice that .htaccess has indeed taken effect immedeately, there is NO 30-60 minutes WAIT PERIOD. PERIOD.
If you are using phpLD and face this problem of redirects not working, or SEF failiing (and this is not just limited to phpLD, this is also applicable for all Joomla, Drupal and other popular softwares) I suggest you to use step by step approach. First ensure .htaccess is loaded, next verify MOD_REWRITE is functional using a dummy redirect to any site. Once this is accomplished, next step is to verify installed Apache Version and read the redirect conditions before you implement them.
If you would like to know what is contained in my .htaccess file for phpLD to work, feel free to ask for it and comment on this article.
And if you are a site owner and would like to register your site on my link directory, you are invited to add your link and give me feedback on the site!!! I would like to know your views and comments.
Cheers,
pubdomains.com – Domain Registration & Web Hosting Services.
Domain Registration * Web Hosting * Secure Certificates * Affordable .in Domain Registration * Blog Hosting
Filed under: GoDaddy, Technology, web hosting, webhosting | Tagged: .htaccess, GoDaddy, link directory, mod_rewrite, phpLD, web directory
[...] unknown wrote an interesting post today onHere’s a quick excerptThe fact is that mod_rewrite DOES work on all GoDaddy servers and often limited skill to work on .htaccess files makes majority think it is web hosting provider that is at fault. I have got mod_rewrite work successfully on my web … [...]
Directives placed in .Htaccess files apply to the directory where you place the file, directories.
Thanks for the informative article. I wanted to add to it by explaining why it takes time for .htaccess to appear on our servers.
Currently our servers use a caching technique for .htaccess files only. This is to avoid, as much as possible, the penalty of traversing your directory structure with each request. This cache is invalidated periodically so that new files are found.
I hope this clarifies things. Thanks again!
Alicia R.
Go Daddy Hosting
Thanks Alicia,
I was frustrated when at first attempt SEF didn’t work, however it didn’t take long to understand the cause and then find solution for SEF URL’s to work. Appreciate your feedback and inputs !!
Best Regards,
Pubdomains
[...] Posts Linux flush DNS cacheFlush DNS or Display DNS ? HTACCESS Does Work On GoDaddyDoes Domain Name Matter? Domain RegistrationFree Web HostingThree Tips to write a good blog [...]
Hello, I’m having trouble getting this to work too- and I am also on GoDaddy.
Would it be possible for you to post the code of your .htaccess file that it currently working with the URL rewrite so that I can attempt to mimic it and just sit back and chill for a few hours knowing that I have the right code?
Lol, this is so frustrating.
Thanks!
Hi Alex,
Good work Man!!!
Just saw your post on blackhatlibrary.com and I believe you finally got it working.
I have phpld 2.1.2 and here is the .htaccess file that is currently working well
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#################################################
## PHP Link Directory - Apache Server Settings ##
#################################################
# Protect files
Order deny,allow
Deny from all
# Protect directories
Order deny,allow
Deny from all
# Disable directory browsing
Options -Indexes
# Follow symbolic links in this directory
Options +FollowSymLinks
# Set the default handler
DirectoryIndex index.php
# URL rewrite rules
RewriteEngine On
RewriteBase /
#Force www Redirect
RewriteCond %{HTTP_HOST} ^ownhost.in [NC]
RewriteRule ^(.*)$ http://www.ownhost.in/ $1 [L,R=301]
#------- Not Required -------------------
#Under Test to Block Spammers
RewriteCond %{REMOTE_HOST} 192\.8
RewriteCond %{REQUEST_URI} /submit\.php$
RewriteRule .* http://www.pubdomainshost.com [R=301,L]
#---------- Code Above is an experiment to block Spam from specific IP Address, Not recommended for all
## Category redirect
RewriteRule ^(.*).html$ linkdetails.php?id=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php [QSA,L]
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I do have the same problem on my directory. I installed it, everything goes well, except the 500 errors. If a category, for example arts, works on seoped.com/directory/arts the path directory.seoped.com/arts gives 500 error. Please help. I tried with the above file but did not work.
Thanks.
Hi Gabi,
Sorry was away from internet for couple of days – thus a delayed response. Had a look at your directory and i am sure I can help you with this.
What version of phpld have you deployed?
Could you share your .htaccess file as well – to see what could be going wrong :0)
Cheers
Pubdomains!
I sent you the .htaccess file.
Thanks a lot!
Does this method work with Windows Shared Hosting on GoDaddy? (htaccess)?? Please get back to me at alexr14@ yahoo.com.
Yes,
the features are identical on win & linux platform.
Thx
Pubdomains