Advertisement:

Author Topic: Strange friendly URL issue I need help with  (Read 1046 times)

trapeezy

  • Newbie
  • *
  • Posts: 16
  • Sometimes I think I need to go back to school
Strange friendly URL issue I need help with
« on: January 12, 2017, 07:23:21 pm »
I'm having a weird issue...something to do with permalinks vs. .htaccess: here is what's happening:
( I hope this is not confusing for anyone...)

Friendly URLS are ON
Here is the .htaccess setup: (suggested setup as shown in admin area)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

--> I start with this friendly URL setup,

Listing URL: {CATEGORIES}/{ITEM_ID}-{ITEM_TITLE}
Page URL: {PAGE_SLUG}
Category URL: {CATEGORIES}

BUT THEN I HAVE ISSUES:
With this setup, none of the main categories links listed on the main page are working, only the sub-categories, main categories show "Page Not Found"

--> In order to fix the main category issue, I alter the rules again (BELOW)

Listing URL: {CATEGORIES}/{ITEM_ID}-{ITEM_TITLE}
Page URL: {PAGE_SLUG}-
Category URL: {CATEGORIES}

BUT THEN I HAVE ISSUES:
** With this setup, the main categories work, everything works, but I am left with a "-" trailing the URL of the pages
FOR EXAMPLE "https://www.MYURL.com/terms-of-use-"
I have even tried this with the "-p" at the end of the rule, which shows up as the url with a "-p" trailing it

--> In order for everything to work I then use the default suggested rules:

Listing URL: {CATEGORIES}/{ITEM_ID}-{ITEM_TITLE}
Page URL: {PAGE_SLUG}-p{PAGE_ID}
Category URL: {CATEGORIES}

BUT THEN I HAVE ISSUES:
** With this setup everything looks good, but the page URLs contain the page ID which I do not want, I think it looks dumb.
FOR EXAMPLE: "https://www.MYURL.com/terms-of-use-p27 (this SHOULD BE "..../terms-of-use")

Now I have Google'd the hell out of this for three days and I still can't figure it out.
Any help would be appreciated.

Thanks
Nick

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Strange friendly URL issue I need help with
« Reply #1 on: January 12, 2017, 10:35:40 pm »
Hi,

Pages need their ID's in the URL, other way they will look as category names to Osclass core.

The only thing you can do it's to camouflage the ID a bit, like:

/{PAGE_ID}/{PAGE_SLUG}

Regards

trapeezy

  • Newbie
  • *
  • Posts: 16
  • Sometimes I think I need to go back to school
Re: Strange friendly URL issue I need help with
« Reply #2 on: January 13, 2017, 06:02:02 am »
Mmmm...

I found this article helped a little along with what you said thanks.
My URL's look like this now "https://www.MYURL.com/pages/terms-of-use"

Which I guess is not so bad, but I still wish it was the other way around.
Why would the contact page get it's own URL without this issue?
If the OsClass Core is pushing out a URL for "contact" then I should be able to do it with custom pages you would think.

I'll keep looking, for now this works thanks for your help, maybe a feature for the new update?

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Strange friendly URL issue I need help with
« Reply #3 on: January 13, 2017, 01:48:44 pm »
Quote
"https://www.MYURL.com/pages/terms-of-use"

Not a bad solution. :)

I don't belong to Osclass team, it's up to them to modify the base sofware.

Regards