Rewrite urls

More
10 years 6 months ago #1739 by MichielStr
Rewrite urls was created by MichielStr
Bram,

In your router.php, you remove the ' & ' and replace it by ''. Somehow this has no effect on the results returned. But when I try to remove other characters, the links no longer work. What can I change to make it work?

Obviously you are not adding the & in the DatafeedsParseRoute function again...

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #1740 by bram
Replied by bram on topic Re: Rewrite urls
Where in the router do I replace the & ?

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #1741 by MichielStr
Replied by MichielStr on topic Re: Rewrite urls
Don't you? Guess I should start adding comments when I change something...

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #1742 by bram
Replied by bram on topic Re: Rewrite urls
I replace spaces that's all, and there shouldn't be any '&' in the urls


The (sef) URL is the input for the query used to display items so if you replace too much the queries won't find a thing.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #1743 by MichielStr
Replied by MichielStr on topic Re: Rewrite urls
No, there shouldn't. But since there are &'s (and /'s, ,'s and -'s) in my categories, I have to get them out.

In a menu 'Audio & video' looks nicer and clearer than 'Audio video'. That's why I cannot simply remove those characters on import...

But this choice is now causing me my next headaches.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #1744 by bram
Replied by bram on topic Re: Rewrite urls
The parser strips 'difficult' characters with a good reason. '&' must be url encodedand decoded correctly. This gave a lot of headaches too.

What you could replace each ' & ' with ' and ' with an import filter

and if you want replace it in the menu's
Code:
print '<option value="'.$i.'">'.str_replace(' and ',' &',$i).'</option>'; #applies to search.php/ajax.php, bit more complicated in default.php

Please Log in or Create an account to join the conversation.

Time to create page: 0.269 seconds