How to remove the word "category" in the URL

Register an Account
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 04-22-2009, 10:38 PM
jongaa's Avatar
New Pligger
 
Join Date: Jul 2007
Posts: 13
The correct code is this:

open ./libs/html1.php
find
Code:
If ($x == "maincategory") {return my_pligg_base."/category/" . $var1;}
If ($x == "storycattitle") {return my_pligg_base."/category/" . $var1 . "/" . $var2 ."/";}
change to
Code:
If ($x == "maincategory") {return my_pligg_base."/" . $var1;}
If ($x == "storycattitle") {return my_pligg_base."/" . $var1 . "/" . $var2;}
open .htaccess
find
Code:
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
below add
Code:
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/?$ ?category=$1 [L]
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/([^/]+)/?$ story.php?title=$2 [L]

example: http://www.digaki.com
Reply With Quote
  #12 (permalink)  
Old 04-22-2009, 11:23 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
Quote:
Originally Posted by jongaa View Post
The correct code is this:

open ./libs/html1.php
find
Code:
If ($x == "maincategory") {return my_pligg_base."/category/" . $var1;}
If ($x == "storycattitle") {return my_pligg_base."/category/" . $var1 . "/" . $var2 ."/";}
change to
Code:
If ($x == "maincategory") {return my_pligg_base."/" . $var1;}
If ($x == "storycattitle") {return my_pligg_base."/" . $var1 . "/" . $var2;}
open .htaccess
find
Code:
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
below add
Code:
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/?$ ?category=$1 [L]
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/([^/]+)/?$ story.php?title=$2 [L]
example: Digaki.com - Fotos e videos de Priscila nua no Paparazzo
Incorrect, that will only partially remove the /category/ urls. Check your upcoming and pagination links.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #13 (permalink)  
Old 04-23-2009, 12:12 PM
jongaa's Avatar
New Pligger
 
Join Date: Jul 2007
Posts: 13
But this is the important part, because these URLs and categories is to be optimized for search engines. The rest is duplicate content. OK?
Reply With Quote
  #14 (permalink)  
Old 04-23-2009, 10:59 PM
Donor
 
Join Date: Jun 2007
Posts: 289
Thanks to all

Hi jongaa, Could you tell me step how to edit file for delete word "category" in both category url and story url with no side effects because I go to check your site and see listing sort menu on category page working very well with no blank page (404)

tecnologia | Digaki.com

Also notice your upcoming category page working also

tecnologia | Novas Noticias | Digaki.com

How you do that?

In ./libs/html1.php, I'd config same you but just wonder in .htaccess file, You mean add those line again below
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]

Is this duplicate with above category code

Code:
##### You can find the below lines pre-made for you in the category management section of the admin panel ######
RewriteRule ^(all|News)/([^/]+)/?$ story.php?title=$2 [L]
RewriteRule ^(all|News)/?$ ?category=$1 [L]
#####
But anyway I'd try your solution by adding another
Code:
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/?$ ?category=$1 [L]
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/([^/]+)/?$ story.php?title=$2 [L]
below
Code:
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
but it's not work. on my mypligg.com/published/yesterday/category/tehnology still show 404 error

sorting menu on category page doesn't work

Quote:
The page you were looking for doesn't exist!

It may have been removed or you may have arrived here by using a bad URL

* Try searching for the article you are looking for.
* Visit the homepage to see the most recent stories.
* Browse categories and tags to find a related story.
this is my example .htaccess

Quote:
##### You can find the below lines pre-made for you in the category management section of the admin panel ######
RewriteRule ^(all|technology|music|news|entertainment)/([^/]+)/?$ story.php?title=$2 [L]
RewriteRule ^(all|technology|music|news|entertainment)/?$ ?category=$1 [L]

#####

##### URL Method 2 ("Clean" URLs) Begin #####
RewriteRule ^cache/([0-9]+)/?$ index.php [L]
RewriteRule ^cache/admin_c([0-9]+)/?$ index.php [L]
RewriteRule ^cache/templates_c/([0-9]+)/?$ index.php [L]
RewriteRule ^story/([0-9]+)/?$ story.php?id=$1 [L]
RewriteRule ^story/title/([^/]+)/?$ story.php?title=$1 [L]
RewriteRule ^story/([0-9]+)/editcomment/([0-9]+)/?$ edit.php?id=$1&commentid=$2
RewriteRule ^story/([0-9]+)/edit/?$ editlink.php?id=$1
RewriteRule ^story/([0-9]+)/modify/([a-z]+)/?$ admin/linkadmin.php?id=$1&action=$2
RewriteRule ^recommend/([a-zA-Z0-9-]+)/?$ recommend.php?id=$1 [L]
RewriteRule ^category/([^/]+)/?$ index.php?category=$1 [L]
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]

RewriteRule ^(all|technology|music|news|entertainment)/?$ ?category=$1 [L]
RewriteRule ^(all|technology|music|news|entertainment)/([^/]+)/?$ story.php?title=$2 [L]

RewriteRule ^upcoming/category/([^/]+)/?$ upcoming.php?category=$1 [L]
RewriteRule ^upcoming/([a-zA-Z0-9]+)/?$ upcoming.php?part=upcoming&order=$1
RewriteRule ^inbox/?$ user.php?view=inbox
RewriteRule ^user/?$ user.php
Reply With Quote
  #15 (permalink)  
Old 04-26-2009, 11:50 AM
jongaa's Avatar
New Pligger
 
Join Date: Jul 2007
Posts: 13
I accessed your site and is working, explain better what is wrong.

"http://techkr.com/published/yesterday/category/tehnology"
Reply With Quote
  #16 (permalink)  
Old 04-27-2009, 12:21 AM
Donor
 
Join Date: Jun 2007
Posts: 289
@jongaa

techkr using RC1 (no problem)

but other sites using RC4 and have problem

this is example (sort menu on category page - day, yesturday, month, year.. all links show 404)

http://ajigg.com/published/yesterday/category/%E0%B9%80%E0%B8%97%E0%B8%84%E0%B9%82%E0%B8%99%E0%B 9%82%E0%B8%A5%E0%B8%A2%E0%B8%B5

i'm using RC4 and see this problem but techkr using RC1 and no have this problem

more example

today link
http://ajigg.com/published/today/category/%E0%B9%80%E0%B8%97%E0%B8%84%E0%B9%82%E0%B8%99%E0%B 9%82%E0%B8%A5%E0%B8%A2%E0%B8%B5

month
http://ajigg.com/published/month/category/%E0%B9%80%E0%B8%97%E0%B8%84%E0%B9%82%E0%B8%99%E0%B 9%82%E0%B8%A5%E0%B8%A2%E0%B8%B5

thanks
Reply With Quote
  #17 (permalink)  
Old 04-27-2009, 02:12 AM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
As mentioned on many other threads these category urls have been fixed in the latest SVN versions. Please upgrade to the latest SVN if you want an immediate fix for the foreign character category urls.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #18 (permalink)  
Old 04-28-2009, 12:08 AM
Donor
 
Join Date: Jun 2007
Posts: 289
@Yankidank

Before I thought my issue is causing by I've been modified html1.php and .htaccess (remove "Category" word) I also see other threads about foreign character category urls but I don't think it's same to me because my normal category links working... Anything, I found that because I haven't upgrade to latest svn.

@jongaa
In your suggestion above, why you leave these 2 lines in .htaccess

Code:
RewriteRule ^category/([^/]+)/?$ index.php?category=$1 [L]
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
Why don't you remove it because these lines make duplicate content

Example:
When you go hxxp://pligg.com/internet ---> This Worked
But when you go hxxp://pligg.com/category/internet ---> This Worked also

So it make duplicate content

But if you remove these 2 lines in .htaccess
You will have only one category permalink

When you go hxxp://pligg.com/internet ---> This Worked
But when you go hxxp://pligg.com/category/internet ---> This Not Work Anymore

And I'm not clear about these lines that you told

Code:
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/?$ ?category=$1 [L]
RewriteRule ^(all|category_01|category_02|category_03|category_XX)/([^/]+)/?$ story.php?title=$2 [L]
"Add below"

Code:
RewriteRule ^category/([^/]+)/([^/]+)/?$ story.php?title=$2 [L]
These lines will deplicate with
Code:
##### You can find the below lines pre-made for you in the category management section of the admin panel ######
RewriteRule ^(all|technology|music|news|entertainment)/([^/]+)/?$ story.php?title=$2 [L]
RewriteRule ^(all|technology|music|news|entertainment)/?$ ?category=$1 [L]
#####
Or not (See example of my .htaccess in above rep)

Thanks
Reply With Quote
  #19 (permalink)  
Old 04-28-2009, 01:03 AM
jongaa's Avatar
New Pligger
 
Join Date: Jul 2007
Posts: 13
Because in some sites that link is well known and has a high page rank. The solution in this case is to redirect 301.
Reply With Quote
  #20 (permalink)  
Old 05-14-2009, 04:12 AM
New Pligger
 
Join Date: May 2009
Posts: 7
I have just implemented what Techkr told on 04-08-2009, 06:00 AM , and it works to me well, see Blbosti.cz - Zábava z celého světa . Hope there is no issues I missed to check which can cause mal function.
Reply With Quote
Reply

Tags
category, url method 2

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I remove the word "Powered By Pligg" on the footer? cekedis Questions and Comments 13 08-12-2011 05:00 PM
Pligg Tutorial: How to Remove the word category from Pligg’s category URL’s pliggedit Questions and Comments 6 09-30-2010 08:56 AM
Paid Help - Make Categories Lowercase and Remove "category" within URL trueMarketing Questions and Comments 12 04-22-2009 12:24 PM
How to remove "category" in url link (SVN r384+URL Method2) Techkr Questions and Comments 5 04-07-2009 04:51 PM
How Do I Remove The Word "Category" from URL? Loz07 Questions and Comments 5 07-03-2008 04:48 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development