apples Posted May 4, 2009 Share Posted May 4, 2009 Hi,I can not get friendly url to work. All the other posts on this forum I have tried but no luck.I'm using hostgator, does this require a special setup?Peter Link to comment Share on other sites More sharing options...
apples Posted May 4, 2009 Author Share Posted May 4, 2009 I am confused as to what to rename the htaccess file toIt was ".htaccess.txt" but I have to drop the "txt" part off the end. But do I keep the full stop/period (.) ?Is it this ".htaccess" or this "htaccess." ???It really seems to make no difference. With the SEO Friendly url turned on in the back office and me renaming the file to either one still does not allow the friendly url to work. All that happens is:The actual URL will show this: http://www.XYZ.com/5-mig-wireBut the page comes up as a 404 error.How can I fix this? I really need to get this working, not just for the SEO value but also in google analytics so that I can see what people are looking at. Right now all I get is the long non english coded text url.Peter Link to comment Share on other sites More sharing options...
Snol Posted May 4, 2009 Share Posted May 4, 2009 HI Apprentice, the address that is being displayed is correct including the 9, but your rewrite rules arent set properly I had this for weeks and between me and "beginner" we worked it out see here http://www.prestashop.com/forums/viewreply/82716/if you have trouble copy and paste all contents of .htaccess here and I will have a look.good luckJohn Link to comment Share on other sites More sharing options...
Snol Posted May 4, 2009 Share Posted May 4, 2009 yes it should read just .htaccess Link to comment Share on other sites More sharing options...
apples Posted May 4, 2009 Author Share Posted May 4, 2009 Okay this is what I have in my htaccess.txt file right now.-----------------------------------------------------------------# URL rewriting module activationRewriteEngine on# URL rewriting rulesRewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$2$4 [L,E]RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [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]# Catch 404 errorsErrorDocument 404 /404.php--------------------------------------------------------------------Can you just copy and paste in your next post what I should use. I am still skeptical as I have tried a few different version of the htaccess code.Peter Link to comment Share on other sites More sharing options...
Snol Posted May 4, 2009 Share Posted May 4, 2009 try this below, it looks like you are missing a / for the product, category, supplier and manufacturer lines.(you will see the first one in front of the word "product". also be aware I have put a slash in front of the cms line as this helps my setup but not sure if will help yours so try with and without /cms.yours shows number 1. instead of just a hash # sign though this may be because of a lost translation in the posting. anyway they should be # hash at the front of just the comment lines as you probably know.REMEMBER ... compare this to your own thoroughly and take a backup copy of your.htaccess so you can flip it back if its wrong.(this should work)good luckJohn# URL rewriting module activationRewriteEngine on# URL rewriting rulesRewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E]RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [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]# Catch 404 errorsErrorDocument 404 /404.php Link to comment Share on other sites More sharing options...
Snol Posted May 4, 2009 Share Posted May 4, 2009 the hashes are losing translation in the postings...make sure you use hashes.JOhn Link to comment Share on other sites More sharing options...
Snol Posted May 4, 2009 Share Posted May 4, 2009 dont forget it should just be a notepad file named .htaccessno txt or stop at the end Link to comment Share on other sites More sharing options...
apples Posted May 4, 2009 Author Share Posted May 4, 2009 Nope still can't get it to work.that is even when I change the 1. to a #and even changing the /cms to just cmsI still get the 404But have noticed that If you search for say "mig wire" in the search box, it will show a list of items, but then when you click to "view" the item it deos the 404 thing again.Peter Link to comment Share on other sites More sharing options...
Snol Posted May 5, 2009 Share Posted May 5, 2009 Strange, there must be something wrong in the rules, I have done lost of these and it always seems to come back to the "/" in the right place, for instance one of my shops is in a subfolder i.e www/mysite.com/prestashop, so the / would then be RewriteRule ^([0-9]+)\-([a-zA-Z0-9-])\.html(.)$ /PRESTAHOP/product.php?id_product=$1$3 [L,E]if you still struggle I can have a look at it through FTP if you want to PM me the details, 2 pairs of eyes are better than one etc. remember to back up before you send me anything. John Link to comment Share on other sites More sharing options...
apples Posted May 5, 2009 Author Share Posted May 5, 2009 Okay so I can now tell you that my shop is also in a subfolder.it is something like this./public_html - this is my first website that is all just stored in this folder.Then my prestashop is under this path or So maybe I should try to put in XYZ.com (the name of the folder) between the two slashes like this/XYZ.com/What do you think? Well I'm going to try it anyway, lol.Peter Link to comment Share on other sites More sharing options...
apples Posted May 5, 2009 Author Share Posted May 5, 2009 Nope that Link to comment Share on other sites More sharing options...
Snol Posted May 5, 2009 Share Posted May 5, 2009 your site knows the first part so if you are in a subfolder you will only need the rewrite rules to be told the sub i.e. www.yoursite.com(your rewrite knows this bit) so in the rules you should put the subfolder if it has one, i.e.RewriteRule ^([0-9]+)\-([a-zA-Z0-9-])\.html(.)$ /subfolder_name_here/product.php?id_product=$1$3 [L,E]this is all it can be, also try turn off seo friendly before change then turn back on after change! Link to comment Share on other sites More sharing options...
apples Posted May 5, 2009 Author Share Posted May 5, 2009 Would this be correct below?I tried that and no good either.I then added it to all the lines, no go either.Should I email hostgator for help? If so what should I specifically ask for? Just if the allow URL rewrites?Peter Link to comment Share on other sites More sharing options...
Snol Posted May 5, 2009 Share Posted May 5, 2009 you dont need the bit that saysthe rest you need but I think you tried this... check hostgator is the best bet. Yes ask them if they allow url rewrtiting, they will look at your code at their end and check it out.sorry I couldnt help, if you think of anything else let me knowJohn Link to comment Share on other sites More sharing options...
apples Posted May 5, 2009 Author Share Posted May 5, 2009 Hostgator do allow URL rewritesThe person in the hostgator chat gave me a link to paid help for stuff like what we are doing.Hmmm, Anyone else got any ideas?Peter Link to comment Share on other sites More sharing options...
apples Posted May 5, 2009 Author Share Posted May 5, 2009 There is only one htacces file isn' t there? It is just in the main folder not hidden in some other folder. I'm just thinking that I might be changing a similar file maybe. Link to comment Share on other sites More sharing options...
Snol Posted May 5, 2009 Share Posted May 5, 2009 there should be only 1 .htaccess file it should be the first file you see underneath the upload folder in root.and it must read just .htaccess Link to comment Share on other sites More sharing options...
Snol Posted May 5, 2009 Share Posted May 5, 2009 As 1 last try, save a copy of your .htaccess to your desktop then PM me and attach the notepad file. let me try it on my site.John Link to comment Share on other sites More sharing options...
apples Posted May 5, 2009 Author Share Posted May 5, 2009 Holy crap, it works....You know what. It had nothing to do with the actual code. Well so I think. What gave me the clue was when you mentioned to use FTP. I was just going into cpanel on the server. Here was the problem, human error.The file had to be named .htaccess all the other files when viewed in cpanel are all showing without the . in place at the front.So I go on via FTP and low an behold there are a few files that have the . showing in front of them. I add the . and preto it works.....Except the php code line thing that you gave me in the PM you sent did make the page go all messed up. But other than that it seems to be working now.THANKS a MILLION. IT was one of those simple little mistakes..My next problem is SSL, I will start another thread for that.Cheers,Peter Link to comment Share on other sites More sharing options...
Snol Posted May 5, 2009 Share Posted May 5, 2009 that is right but trust me...the spaces were not allowed as I tried it with and without the spaces here and it wouldnt work. at soe stage you moved just 3 spaces without knowing it, so if you move it in future be aware of this also.Anyway, well doneJohn Link to comment Share on other sites More sharing options...
AndrewHuk Posted December 21, 2009 Share Posted December 21, 2009 Hello All,Has anyone got the Friendly Urls to work with Hostgator? I have enabled them and created the htaccess file however, i keep getting the following for every link except the manufacturers box:We're sorry, but the Web address you entered is no longer available Any Ideas?Andrew Link to comment Share on other sites More sharing options...
Recommended Posts