.htaccess help

I have to recognize that I didn’t do a .htaccess before. I worked with joomla or wordpress and this file came automatically.
On this website

http://www.aproapetot.ro/page.php?categ_id=1&id=10

after .ro I have a category(1) and then a subcategory(10). It is a site with jokes. So I want, for ex, to have:

.ro/jokes/doctors

I tried for days some tutorials but without any succes :smile:. Someone, please, give me a little help with the rewrite rules.

Your site is showing a Malicous Warning which I think wants removing before any .htaccess modifications.

Malicious site warning

This site may be hacked or contain malicious software. Visiting this page may be harmful.
Opera Software strongly discourages visiting this page.

Go Back Safely Ignore this warning Why was this page blocked?

My friend I got the same message almost every time when I open an cpanel to diff websites. What that means that the cpanel is corrupted, or has a virus :slight_smile: ? I don’t think so. Thank you for trying to help me.

No - that one means they are logging in and the security certificate belongs to the hosting provider and not to their site.

It is a completely different message from the one telling you that your site has been hacked.

Going from a name (such as “doctors”) to an ID number (such as “10”) isn’t something htaccess can do by itself. That kind of translation requires a database lookup. Your PHP script needs to be able to look up entries by an ID name (often called a slug). So your first step is to update your PHP script so that a URL such as this could work:

/page.php?categ_slug=jokes&slug=doctors

I work on this site for a few weeks, because it’s a hobby. I put diff questions on php forum, here, and on other forums and nobody told me that my website has been hacked. Everyone helped me and I finished what I asked because they helped me.

I asked a few people to check my site and nobody found anything suspect or wrong.

Thank you Jeff. And let’s say that I have that slug. What is the next step?

The next step could be as simple as:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)$ page.php?categ_slug=$1&slug=$2 [QSA]

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.