SimplePortal

Support => English Support => Topic started by: srinib on April 03, 2013, 03:35:10 AM

Title: Can't we use hyphen(-) in Page ID?
Post by: srinib on April 03, 2013, 03:35:10 AM
I am having problem with the "Page ID".
I want to name Page ID = Good-Key-Words. But if won't take that way.

We get a message saying,
Quote
Sorry, there are invalid characters in the page ID. Page ID's can only contain letters, numbers and underscores.

I know we can substitute underscores for that.
But i read in an SEO book that search engines just ignore the pages with underscores . They don't mean this link won't be indexed. But it says the key words are not considered.

This is what it says,
Bad practice: don't use underscores
http://www.MyDomain.com/index.php?page=Good_Key_Words

Good practice: use hyphen(-)
http://www.MyDomain.com/index.php?page=Good-Key-Words

So, is there something we can do to accomodate hyphen(-) also?
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: andy on April 03, 2013, 01:26:47 PM
Yes '_' works fine ...

I havent test hyphen.


I do not think it makes any difference than using hyphen. On SMF there is a lot of debate about keywords and SEO but most senior people there agree that for search engines the most important thing is the 'content'. This is what they use for indexing. Sites have lots of fake keywords to attract people but smart search engines use the content - that will keep their users happy if they return correct search results.

I would not worry about it - my pages come up fine on search results.
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: srinib on April 04, 2013, 03:25:28 PM
You are right. For search engines, content is the king. But apart from that there are many other factors which contribute to the lift. And the naming of these pages is one of them.

igirisjin, I think you know better than me about these stuff. I see your site has a good PR.  ;) Your site looks great.
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: srinib on April 05, 2013, 02:44:42 AM
Any idea where this Page ID information is stored(i mean in which table)?
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: andy on April 05, 2013, 04:19:01 PM
Quote
Any idea where this Page ID information is stored(i mean in which table)?
I dont know, but one easy way to find it is maybe to give a page a unique name (not number), save and then download your database and search it for that unique name.
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: srinib on April 07, 2013, 01:46:52 AM
Can Simple Portal Team please consider this "hyphen(-) in Page ID" in their next version? It is really important to me and i guess it will be helpfull for others too.
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: andy on April 08, 2013, 02:30:43 AM
You can make a feature request for that.

http://simpleportal.net/index.php?board=9.0



Title: Re: Can't we use hyphen(-) in Page ID?
Post by: ccbtimewiz on June 10, 2013, 11:43:03 PM
The hyphen is failing because it makes a check inside a file go false and triggers a fatal_lang_error

It's located in PortalAdminPages.php here:

Code: [Select]
if (preg_match('~[^A-Za-z0-9_]+~', $_POST['namespace']) != 0)
fatal_lang_error('sp_error_page_namespace_invalid_chars', false);

A solution would be to completely remove the check entirely like so:

Code: [Select]
if (empty($_POST['namespace']))
fatal_lang_error('sp_error_page_namespace_invalid_chars', false);

This will allow you to post any character you want (besides blank). Of course this can create serious problems, just make sure you know what you're doing by removing this.

Alternatively if you want to keep the restriction and just include a hyphen in the allowed characters, perhaps edit the statement like so:

Code: [Select]
if (preg_match('~[^A-Za-z0-9_\-]+~', $_POST['namespace']) != 0)
fatal_lang_error('sp_error_page_namespace_invalid_chars', false);

However removing the check entirely will give you vast more opportunity to play with what you want...
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: FroschLee on October 08, 2015, 09:33:13 AM
The hyphen is failing because it makes a check inside a file go false and triggers a fatal_lang_error

It's located in PortalAdminPages.php here:

Code: [Select]
if (preg_match('~[^A-Za-z0-9_]+~', $_POST['namespace']) != 0)
fatal_lang_error('sp_error_page_namespace_invalid_chars', false);

A solution would be to completely remove the check entirely like so:

Code: [Select]
if (empty($_POST['namespace']))
fatal_lang_error('sp_error_page_namespace_invalid_chars', false);

This will allow you to post any character you want (besides blank). Of course this can create serious problems, just make sure you know what you're doing by removing this.

Alternatively if you want to keep the restriction and just include a hyphen in the allowed characters, perhaps edit the statement like so:

Code: [Select]
if (preg_match('~[^A-Za-z0-9_\-]+~', $_POST['namespace']) != 0)
fatal_lang_error('sp_error_page_namespace_invalid_chars', false);

However removing the check entirely will give you vast more opportunity to play with what you want...

İ try this and working fine.

Code: [Select]
if (preg_match('~[^A-Za-z0-9_/\-]+~', $_POST['namespace']) != 0)
fatal_lang_error('sp_error_page_namespace_invalid_chars', false);

my page id is looking like = > deneme/deneme
But if i open prettyurls this is not working. How can i fix it for work with prettyurl?
Title: Re: Can't we use hyphen(-) in Page ID?
Post by: ♦ Ninja ZX-10RR ♦ on October 08, 2015, 07:28:39 PM
FroschLee,

Hi and welcome to SimplePortal!
Unfortunately PrettyUrls is very well known to be the cause of random and odd issues, without even really boosting the SEO - ref: http://www.simplemachines.org/community/index.php?topic=427913.0
So your best option is to try asking the mod author, since it's not a SimplePortal problem.

Regards
SimplePortal 2.3.8 © 2008-2024, SimplePortal