I am trying to make a URL go to a file which is a WordPress page template.

I am doing a website that has categories and subcategories then a details page.

First off I am try to make.

**The “category_name” is dynamic and pulled from a non WordPress database.

I am trying to get that any time the URL is www.my-site/explore/whatever. It points to /wp-content/themes/my_theme/myfile.php

Here is my htacess file.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^explore/([a-z0-9-]+)$ /wp-
    content/themes/visitsi_theme/listing-page.php [NC]

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

END WordPress

Read more here: .htaccess not working WordPress. Make a url go to a file


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: