|
#1
|
||||
|
||||
|
Hi, I just purchased the Baby package from HostGator.
I am trying to figure out how to always have 'www.' in my website's URL (ie: http://HostGator.com will take you to http://www.HostGator.com). I'm sure it's simple, but I cannot seem to figure it out. Also, where do I upload my files? I added my own 'index.html' page in my 'www' directory, but when I go to my domain it still goes to the HostGator default page. I need to go to 'mydomain.com/index.html/' in order to view my page. Thanks. P.S. Would someone mind approving my forum account? I'm sure there is a better place for this thread once I can view the whole forum. |
|
#2
|
||||
|
||||
|
I accidently deleted 'public_html' and when I re-uploaded it I am getting a 403 Forbidden message. What's wrong?
|
|
#3
|
|||
|
|||
|
If you deleted your public_html folder, then you'll need to place a ticket, to have the following done:
cd /home/savage21 chmod 0750 public_html chown savage21.nobody public_html |
|
#4
|
||||
|
||||
|
As far as your first two questions go--to force www, put this in your .htaccess:
Code:
RewriteCond %{HTTP_HOST} ^DOMAIN\.com [NC]
RewriteRule ^/?(.*) http://www.DOMAIN\.com/$1 [R=301,L]
For the second one, delete the "default.html" or "default.php" file from your account, and index.html should automatically become the default.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#5
|
||||
|
||||
|
I submitted a ticket last night and they fixed it for me.
I'll try the .htaccess thing when I get home, slapshotw. And I think the index problem is fixed as well. Thanks. One more question: If I recall correctly, I don't have a .htaccess in my files. Do I just create a page with the code you gave me and name it .htaccess? |
|
#6
|
|||
|
|||
|
.htaccess is (or should be) in your public_html folder.
Here is a little tutorial on what htaccess is and how to edit it. :3 htaccess Tutorial Good luck. :] |
|
#7
|
||||
|
||||
|
When I uploaded .htaccess to the public_html folder it said I already have that file and asked if I wanted to override it. I don't see it though?
|
|
#8
|
|||
|
|||
|
If you're going through File Manager, then you might not have ticked the 'show hidden files' checkbox that would allow you to see those types of files.
|
|
#9
|
||||
|
||||
|
Thanks. I found it and added the code but when I go to my site without www. it still doesn't add it.
|
|
#10
|
|||
|
|||
|
Try this code:
Quote:
|
|
#11
|
||||
|
||||
|
Thanks mate, works great.
Edit: Sorry for the trouble, but when I go to 'mydomain.com/forum' it doesn't seem to add the www. part. Last edited by Savage21; 04-14-2008 at 04:14 PM. |
|
#12
|
|||
|
|||
|
After commenting out /forum/.htaccess, it works now. It was overriding the parent .htaccess
|
|
#13
|
||||
|
||||
|
Thanks, now it works.
But wherever I go on my site I get a 500 Internal Server Error. What happened?
|
|
#14
|
|||
|
|||
|
.htaccess was broke, had a '#' right after a rule where you had Begin Wordpress, was messing it up.
Fixed. Now ya just gotta work on your public_html/ |
|
#15
|
||||
|
||||
|
Thanks.
WordPress didn't seem to work. Actually, WordPress was apearently the cause of that. Is it safe to try to reinstall WordPress again? Something was failing to upload the first time, but I was able to setup an account for myself. It wasn't until I went to the wp-login page that I got the error. |
|
#16
|
|||
|
|||
|
I'd take out those rules for a sec, install wordpress, then append the rules back to the end of that file, that should fix it.
|
|
#17
|
||||
|
||||
|
Yup, I'm all set now. Thanks again for all the help.
|
|
#18
|
|||
|
|||
|
Hey!
No need to uninstall/reinstall WP. Just go to Setting/General and change WordPress address (URL) and Blog address (URL) sections.For example: http://domain.com/wp >> http://www.domain.com/wp |
|
#19
|
|||
|
|||
|
|
|
#20
|
||||
|
||||
|
should be the same as the other code posted here except the www is in RewriteCond and not RewriteRule. (You may have to change http to https if you want it for https)
e.g.: Code:
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
|
|
#21
|
|||
|
|||
|
hi guys
i've got a similar problem but with Joomla. Its in a subdirectory, so its www.mydomain.com/joomla If i type www.mydomain.com/joomla I get http://mydomain.com/joomla So I played with the above code in my .htaccess file. And got some success but not completely. ie: 1. If I type www.mydomain.com/joomla/ (with backslash at the end) it works fine. 2. But if there is no backslash at the end, then its back to http://mydomain.com/joomla 3. Also, if i just type http://mydomain/joomla, then it stays the same. (no big deal, but I would prefer for it to work for (1) and (2) above I've added the code to: 1. Just the htaccess file in public html 2. Just to htaccess in Joomla directory 3. To both htaccess files All 3 ways yield the same results. One other things to note: My joomla configuration file ihas the live url set correctly. ie http://www.mydomain.com/joomla Anyone have any tips? Thanks |
|
#22
|
|||
|
|||
|
infra-greg, what code you are using in .htaccess ?
|
|
#23
|
|||
|
|||
|
hey ghpk
this is the full htaccess code in my joomla directory with the code mentioned earlier in this thread (in red below) Code:
## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
#
# mod_rewrite in use
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain/joomla\.com [NC]
RewriteRule ^/?(.*) http://www.mydomain/joomla\.com/$1 [R=301,L]
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla!/MamboDirectory (just / for root)
# RewriteBase /
########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section
########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|