0

I have this on my .htaccess:

RewriteEngine On
RewriteRule ^category/([A-Za-z0-9-]+)$ category.php?name=$1
RewriteRule ^([A-Za-z0-9-]+)$ article.php?url=$1

The article page is ok, showing like this:

http://www.example.com/article-name

But the category page I would like to change from:

http://www.example.com/category/category-name

To:

http://www.example.com/category-name

In my pages, I send the url with this:

<a href='/category/". $art_url"'></a>

The problem is when I change the string inside of the .htaccess to the same of the article, category shows ok but the article page comes with no content.

Please, how can I achieve what I need.

Thanks in advance.

Andre Oliveira
  • 197
  • 2
  • 10
  • You need to change your URLs to `/article-name` and add a rewrite rule to change them to `article.php?url=$1`. What exactly is the problem? – deceze Dec 09 '14 at 01:22
  • Thanks for the quick response @deceze. I have changed the .htaccess to RewriteRule ^([A-Za-z0-9-]+)$ category.php?name=$1 RewriteRule ^([A-Za-z0-9-]+)$ article.php?url=$1. Also changed the url to . The problem is that when I click in category it shows ok, but inside of category when I click in the article it does not show anything – Andre Oliveira Dec 09 '14 at 01:41

0 Answers0