XHTML Validation & phpMyFAQ

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
natmanu
Posts: 22
Joined: Wed May 24, 2006 7:07 pm

XHTML Validation & phpMyFAQ

Post by natmanu »

I've been trying to validate my XHTML pages using the W3 (http://validator.w3.org)

Because I'm using phpMyFAQ feeds output on my pages and using it for the whole FAQ section most of my URL look like this:

http://www.uvolunteer.org/faqs/index.ph ... artlang=en

this URL will fail XHTML validation cos there are unencoded ampersands in URLs. So ( cat=1&id ) should really be ( cat=1&id ) the entity for the ampersand for it to pass.

I think you can change this by setting your php arg_separator.output in php.ini to something like '&' or ';' so I've sort of answered my question. But that bring all sorts of other problems based on the type of hosting being used. So the real question is would it be possible to modify the URL so it would read something like:

http://www.uvolunteer.org/faqs/catergor ... hema_name/

with the title words seperated by underscores. I'm thinking this would be great for search engine optimisation and also very user friendly.

I've searched around and I'm now looking into the Apache Module 'ModRewrite' as a solution. Would it be possible to make this change to the phpMyFAQ script or is it something that the server should handle?

If anyone has had similar problems with this issue, I'd be greatfull if you would share your findings.

Cheers
Nat
Thorsten
Posts: 15793
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

we already have support for mod_rewrite in phpMyFAQ. The support of the record title in the URL will be supported in 2.0 and is already implemented.

I thought we fixed all unencoded ampersands but I will take a look on that.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
natmanu
Posts: 22
Joined: Wed May 24, 2006 7:07 pm

Post by natmanu »

Silly me!
I was searching the forum using the wrong keywords, xhml intead of mod_rewrite!!!!!!!!!!!!!!!!!!

Thanks that's sorted now.

Once modwrite is activated in the admin control panel and .htaccess, will it also affect the output of the rss feeds? If not then that's where the unencoded ampersand will probably be be hiding, if there are any :-)
Or is it up to the rss pharser to take care of that?

Cheers
Nat
Thorsten
Posts: 15793
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the RSS feeds currently do not use URLs with mod_rewrite but they will do in 2.0.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Re: XHTML Validation & phpMyFAQ

Post by matteo »

Hi Nat,
natmanu wrote:Because I'm using phpMyFAQ feeds output on my pages and using it for the whole FAQ section most of my URL look like this:

http://www.uvolunteer.org/faqs/index.ph ... artlang=en

this URL will fail XHTML validation cos there are unencoded ampersands in URLs. So ( cat=1&id ) should really be ( cat=1&id ) the entity for the ampersand for it to pass.

I think you can change this by setting your php arg_separator.output in php.ini to something like '&' or ';' so I've sort of answered my question. But that bring all sorts of other problems based on the type of hosting being used.
If you're still using this code for managing the RSS feeds, you could replace the line for evaluating $url just to read:

Code: Select all

...
$url = str_replace("&", "&", $item['link']); 
...
Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
natmanu
Posts: 22
Joined: Wed May 24, 2006 7:07 pm

Post by natmanu »

Cheers Matteo,

That's good to know. I'm currently using the srt_repace() function whilst pharsing the RSS feed.

Cheers
Guess you are still enjoying your World Cup victory :-)
Nat
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi Nat,
natmanu wrote:Guess you are still enjoying your World Cup victory :-)
Just a little :wink:, unfortunately I'm feverish (38+) since sunday afternoon.

Cheers,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Post Reply