Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 04:42 am EST
Geeklog Forums
GoDaddy: uploading a .htaccess file
Jack
Anonymous
I am trying to get a .htaccess (to redirect non-www to www) file to work on my GoDaddy web server. I created a .htaccess file and uploaded it to my root directory. When I load it directly into the /, it gives a 500 server error.
So I created a .htacess directory (in the root), and tried loading it there. It does not work, i.e., my website is visible, but no redirect. Note: I waited an hour for the server to cache=nothing.
Here is the code I Used:
Options +FollowSymLinks (I tried with and without this line)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301, L]
Of course, I put my site in where it says "example."
I checked the URL of the access file an it reads:
ftp://websiteowner@xx.xx.xxx.xxx/.htaccess (my GoDaddy account)
Any suggestions on why nothing is working?
So I created a .htacess directory (in the root), and tried loading it there. It does not work, i.e., my website is visible, but no redirect. Note: I waited an hour for the server to cache=nothing.
Here is the code I Used:
Options +FollowSymLinks (I tried with and without this line)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301, L]
Of course, I put my site in where it says "example."
I checked the URL of the access file an it reads:
ftp://websiteowner@xx.xx.xxx.xxx/.htaccess (my GoDaddy account)
Any suggestions on why nothing is working?
9
7
Quote
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hi,
Try
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^\/?$ "http\:\/\/www\.example\.com\/"
Ben
I'm available to customise your themes or plugins for your Geeklog CMS
Try
Text Formatted Code
RewriteEngine OnRewriteCond %{HTTP_HOST} ^example.com$
RewriteRule ^\/?$ "http\:\/\/www\.example\.com\/"
Ben
I'm available to customise your themes or plugins for your Geeklog CMS
8
8
Quote
Jack
Anonymous
Thanks.
Tried this, and it appeared to work. But after several refreshes, nothing happens.
I assumed you meant to put it in the root "/" in my present .htacess directory minus the present contents, and without the "Options +FollowSymLinks" clause.
Tried this, and it appeared to work. But after several refreshes, nothing happens.
I assumed you meant to put it in the root "/" in my present .htacess directory minus the present contents, and without the "Options +FollowSymLinks" clause.
24
8
Quote
Jack
Anonymous
I believe it was a server side problem. Tech did some things on their end. The original code (slightly modified) is now working.
9
4
Quote
All times are EST. The time is now 04:42 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content