Jump to content
HA!*!*Y

[Override] Friendly Urls Without Id Number For V1.5

Recommended Posts

if use [color=#343943][font=Arial, Helvetica, sans-serif][size=3]Route to products: [/size][/font][/color][b]{categories:/}{rewrite}{-:ean13}.html , url is like:[/b]

www.mysite.com/root/home/accessories-ipod/ecouteurs-a-isolation-sonore-shure-se210-blanc.html?product_rewrite=ecouteurs-a-isolation-sonore-shure-se210-blanc

if use only [b]{rewrite}{-:ean13}.html url is ok ... what is the point ?[/b]

Share this post


Link to post
Share on other sites
[quote name='corint1' timestamp='1353806099' post='1018215']
if use [color=#343943][font=Arial, Helvetica, sans-serif][size=3]Route to products: [/size][/font][/color][b]{categories:/}{rewrite}{-:ean13}.html , url is like:[/b]

www.mysite.com/root/home/accessories-ipod/ecouteurs-a-isolation-sonore-shure-se210-blanc.html?product_rewrite=ecouteurs-a-isolation-sonore-shure-se210-blanc

if use only [b]{rewrite}{-:ean13}.html url is ok ... what is the point ?[/b]
[/quote]

It's up-to you, if you want you could do only: [b]{rewrite}.html[/b]

Are you using multishop? Edited by HA!*!*Y

Share this post


Link to post
Share on other sites
Hi, I have applied your fix and it works perfectly. The only problem is that the link does not work from home or the CMS any ideas?

thanks

P.D: sorry for my english :P

Share this post


Link to post
Share on other sites
This works fine on one site both in categories and products but in another site I tested this on today the category URL is getting a %20 added to the URL /%20rocking-horses/ any idea, have I missed something. Edited by tdr170

Share this post


Link to post
Share on other sites
[quote name='tdr170' timestamp='1354726236' post='1029825']
This works fine on one site both in categories and products but in another site I tested this on today the category URL is getting a %20 added to the URL /%20rocking-horses/ any idea, have I missed something.
[/quote]

there is a space in your URL rewright link you can remove it by editing the items SEO URL

[url="http://www.w3schools.com/tags/ref_urlencode.asp"]http://www.w3schools...f_urlencode.asp[/url]
ASCII Character ----- URL-encoding
space ------------------ %20 Edited by HA!*!*Y

Share this post


Link to post
Share on other sites
[quote name='mrashole' timestamp='1354206969' post='1023761']
...The only problem is that the link does not work from home or the CMS any ideas? ...
[/quote]

Where on the home & where/what CMS page?

Can you send me the page url or an screenshot of it?

Share this post


Link to post
Share on other sites
I'm sorry but i revert the changes on my site.

The problem was in all cms pages, if i click in a link to cms page the prestashop return 404 error.

I have installed the prestashop in a subfolder of my domain it can be the problem?

Thanks.

P.D: tomorrow i will reinstall your fix, can i send a private message to see and check the problem? Lots of thanks dude Edited by mrashole

Share this post


Link to post
Share on other sites
[color=#343943][font=Arial, Helvetica, sans-serif][size=3]Hi! i Install copy the the files in to override folder:[/size][/font][/color]

[color=#343943][font=Arial, Helvetica, sans-serif][size=3]/override/controllers/front/CategoryController.php - ok[/size][/font][/color]
[color=#343943][font=Arial, Helvetica, sans-serif][size=3]/override/controllers/front/ProductController.php - ok[/size][/font][/color]
[color=#343943][font=Arial, Helvetica, sans-serif][size=3]/override/classes/Dispatcher.php - error[/size][/font][/color]

[color=#343943][font=Arial, Helvetica, sans-serif][size=3]And i have [/size][/font][/color][color=#777777][font=Helvetica, Arial, sans-serif][size=3]HTTP 500 (Internal Server Error)[/size][/font][/color]

[color=#777777][font=Helvetica, Arial, sans-serif][size=3]whats problem?[/size][/font][/color]

Share this post


Link to post
Share on other sites
Thanks, but I'm a fool, I copied the files to the wrong folder

all ok, but main page not work (error 404) all other page with product - ok Edited by aeroplah

Share this post


Link to post
Share on other sites
I'm testing the override in PS 1.5.2 demo store and it works! Great job.
It's very important to have the rigth values under Preferences > SEO:

[quote][color=#343943][font=Arial, Helvetica, sans-serif][size=3]Route to products: [/size][/font][/color][b]{categories:/}{rewrite}{-:ean13}.html[/b]
[color=#800000][font=Arial, Helvetica, sans-serif][size=3]*Does not work with {category:/} see Bug report for a fix:[/size][/font][/color][url="http://forge.prestashop.com/browse/PSCFV-4978"]http://forge.prestas...owse/PSCFV-4978[/url]
[color=#343943][font=Arial, Helvetica, sans-serif][size=3]Route to category: [/size][/font][/color][b]{rewrite}/[/b]
[color=#800000][font=Arial, Helvetica, sans-serif][size=3]*It must have a ending slash[/size][/font][/color]
[color=#343943][font=Arial, Helvetica, sans-serif][size=3]Route to category with attribute selected_filter for the module block layered: [/size][/font][/color][b]{rewrite}/{selected_filters}[/b]
[color=#800000][font=Arial, Helvetica, sans-serif][size=3]*moved the slash[/size][/font][/color][/quote]

Here are my 2 cents. In my demo store, the url of the products is the following:
[quote]http:// localhost/prestashop/root/home/category/product.html[/quote]

To remove "/root/home" I used the solution proposed in this [url="http://juanluismora.es/seo/configuracion-y-optimizacion-seo-de-prestashop-1-5-1/"]blog[/url].

Basically, you have to modify getProductLink method from /classes/Link.php class and add this:

[quote]
$cont = 0;
foreach ($product->getParentCategories() as $cat) {
$cont++;
if($cont>2)
$cats[] = $cat['link_rewrite'];
}
[/quote]

I've attached my modification, you've to add this file in /override/classes/ Edited by cloder

Share this post


Link to post
Share on other sites
sjk    0
I've just tried this in 1.5.3.1 and it doesn't work.

Does anyone know the existence of this mod that works?

Share this post


Link to post
Share on other sites
Took me some time to figure out all the details, but now it works like a charm on prestashop 1.5.2, thanks a lot op!!

url now is: yoursite/en/laptops/macbook-air.html

if anyone wants help with that, contact me!

Share this post


Link to post
Share on other sites
Hi [url="http://www.prestashop.com/forums/index.php?/user/304183-hay/"]HA!*!*Y[/url],

Awesome work and great.

[u][b][color=#ff0000]Can you or someome tell me how to do this for cms? I want to make landing pages and i need to remove category for better ranking.[/color][/b][/u] Edited by Abdul1987

Share this post


Link to post
Share on other sites
Hi,
I test again with Prestashop 1.5.3.1 and it's great for products and homepage.

Is someone know how to add parent categories to category url like this => "www.mysite/parent-category/category/
For moment I have this:
"www.mysite/parent-category/"
and
www.mysite/category/

Share this post


Link to post
Share on other sites
I found a way to:

- Remove IDs in products, categories, and also CMS (based on Ha!*!*Y work)
- Add ALL the parent categories to subcategories URLs!! (Little override in Link.php class)

I am refraining to share it with everyone because I saw that there are people who sell this mod (without the second feature). So no, I don't share for now...

I will post an example ASAP to prove I did it.

Can I talk with the DEVs so they can consider integrating it in next PS version? Edited by lapy90

Share this post


Link to post
Share on other sites
PS 1.5.3.1

Homepage is not working (404)
checkout and order pages are not working either (404)

Categories and products show correct URLs!

Has anyone fixed the homepage and checkout?

[quote name='lapy90' timestamp='1358801481' post='1077898']
Can I talk with the DEVs so they can consider integrating it in next PS version?
[/quote]

If you want the devs to integrate it, you need to add a bug at the [url="http://forge.prestashop.com"]forge[/url], provide a patch (and possibily push it to [url="https://github.com/PrestaShop/PrestaShop"]github [/url]aswell) Edited by EV Network

Share this post


Link to post
Share on other sites
To fix the home page try to set the URLs correctly in URL & SEO page:

probably you didn't set {rewrite}/ for category! (the position of the slash is important)

Share this post


Link to post
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

×