0

I have url: domain.com/articles/index.php?article_id=1&lang_id=1 in sql database I have title and permalinks (unique permalinks).

The article title is: article title
The permalink: article-title-permalink

Is there any way to rewrite:

this link: domain.com/articles/index.php?article_id=1&lang_id=1
to this: domain.com/article-title-permalink
or to this: domain.com/article-title

I am novice. I have searched everywhere but couldn't get result. I even bought several courses, but no result.

halfer
  • 18,701
  • 13
  • 79
  • 158

1 Answers1

0

I think you're mixing up concepts and words.

My guess is that you want somebody to point his browser to domain.com/article-title-permalink and your application, somehow (we'll get there), to execute the code in domain.com/articles/index.php?article_id=1&lang_id=1

Please correct me if i'm wrong.

There is no direct way to do that, but what you can do is to replace your index.php file to, instead of expecting an article_id parameter, expect the article_permalink parameter, so this way you can rewrite the URL, using the .htacces file, as you tagged your question with ti, to do that.

Would that help? There is more ways to solve this, but i guess it depends on the context of what you want/need.

peiiion
  • 310
  • 2
  • 4
  • You are right. can you please tell me the solution? – Kote Laperashvili Nov 29 '16 at 06:43
  • and one more question: I use codeigniter framework. Url for the article is domain.com/articles/view/about-us I want somebody to point his browser to : domain.com/about-us and my application somehow to execute the code: domain.com/about-us Thank you very much – Kote Laperashvili Nov 29 '16 at 06:46
  • Check the duplicated link where you can find an entire explanation on how to use .htaccess Rewrite commands. – peiiion Nov 29 '16 at 14:44