Jump to content

.htacces help


trusbuy

Recommended Posts

And I also tested this on the web server, where I change the permission of the .htacces file to 666, And still when I click generator there's error returned like this:

500 Error - Internal Server Error
This error was caused due to an unexpected difficulty in fulfilling the user request. The most likely cause of this error is a crashed or error'd CGI script or program. Please verify that the program is properly compiled and/or operational and carry out any necessary debugging.
If you are not responsible for this resource, please send a bug-report to the address listed below describing your problem. Please include in the report the date, time, your e-mail address, the website on which this error occured and what you were attempting to do when this error occured. Your compliance is appreciated.

Link to comment
Share on other sites

Umm this comes a little late but perhaps you should not leave the file blank. I used this code in my file to keep from getting the 500 internal error message::

 

order allow, deny
deny from all



This is what I used to get started. However, the friendly URL is showing the cat id number then - (keyword) so I am still looking into how to make a url friendly. I did find some modules, but I wanna test the options and wait for Google to crawl my site and see if they are able to find the and see the file-extensions.

I am not sure but I thought too many .htaccess can get you banned. So having a bunch of re-writes for the entire site seems to make me a little paranoid.

I shall return in a day or two with some answers

Link to comment
Share on other sites

oh and if you wanna change the permissions, the gui that use use to maniplate or ftp files to your server, should have a radio button that you can select where you can change the permissions. If you do not have a gui and all you have is the command line shell, then just Google "changing file permission command line" that should get you going in the right direction. Sorry I hope this helps, just thinking outside the box about your problem. You know you can also generate a .htaccess file from the "tools" part of your back office.

Should look something like this:::

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [QSA,L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [QSA,L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang;=$1$5 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang;=$1$4 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /404.php




Last, I am going to look into the url rewrites againse known SEO rules and make sure this will not get your pages banned by Google. If not, then I see a module might be out there to handle this problem. :-))

Link to comment
Share on other sites

First, I believe I read somewhere that Google penalises temporary 302 redirects, but not 301s.... the webmaster tools on Google allows you to tell them about redirected webpages.

Second - help with htaccess...

I use this website to generate my 'initial' rewrite rule (so I have a template to work from):
http://searchfriendlyurls.com/

Then I write a PHP script to create the rest of the .htaccess file - for example:

//Get each product from DB
$products_name_query = "select products_id,products_name from products";
$result = mysql_query($products_name_query);

//Loop results
while($row = mysql_fetch_assoc($result))
{
//My code to format the URLs to how I've rewritten them

$string_to_be_stripped = $row['products_name'];
$new_string = ereg_replace("[^A-Za-z0-9]", "", $string_to_be_stripped );

$name = strtolower(str_replace(" ","_",$new_string));
$id = $row['products_id'];

//echo the format
echo "RewriteRule ^".$name."\.html$ //product_info.php?products_id=".$id." [L]
";
}



Copy & paste output of script to .htaccess file. This is just an example & will need to be tweaked for Presta...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...