Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Better .htaccess File
 
Mark_Kimsal
Sr. Member
 
Total Posts:  186
Joined:  2007-09-12
Michigan, USA
 

Something like this is a lot more welcoming to people the first time they open up the .htaccess file.  Generally, I will distribute my htaccess files as a file called “dot_htaccess”, with instructions to copy the file to .htacess if the user makes some changes to it.  It just makes it easier for them to see it if their FTP client hides hidden files.

Contents of “dot_htaccess.txt”:

#Please copy this file to “.htaccess” (without the quotes).
#
#The dot in front of the name makes this a hidden file, so we
# distribute the file as “dot_htaccess” so that everyone can see it.

#These flags might cause errors on some systems.  Please comment them out
# if your installation is not functioning properly.
#To comment them out, simply put a hash-mark (#) at the beginning of the line.
php_flag magic_quotes_gpc off
php_flag short_open_tag on

DirectoryIndex index.php

RewriteEngine on

#use this if your URL is like http://www.example.com/~user/magento/
#RewriteBase /~user/magento/

#Uncomment this line if your URL is like http://www.example.com/magento
#RewriteBase /magento/

#Uncomment this line if your URL is like http://www.example.com/shop
#RewriteBase /shop/

#you don’t need anything if magento is installed at http://www.example.com/

RewriteCond %{REQUEST_URI} !^/media/
RewriteCond %{REQUEST_URI} !^/skin/
RewriteCond %{REQUEST_URI} !^/js/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
markf
Sr. Member
 
Total Posts:  145
Joined:  2007-09-20
 

I agree, this might be helpful to some.  I had this happen to me actually.  I uploaded all the files and was experiencing problems until I realized there were some hidden .htaccess files in many of the folders.  Once I changed my FTP program to view hidden files and uploaded them, everything worked.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top