-1
In Wordpress:
On a template page:
I have a link: <a href="http://localhost/wpcurso/exercicios-questoes/?id='.$row->id_exercicio.' " >' . $row->titulo . '</a>
That points to another template page: <?php /* Template Name: exercicios-questoes */ ?>
How to make this link friendly URL to the second template page?
My htacess is the Worpress standard:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wpcurso/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wpcurso/index.php [L]
</IfModule>
# END WordPress
I’m not using Function in this example. I already get the id from one page to another through a get on the template page, I receive and list the right one coming from the bank, I want to know what rule in htacess create to receive that link I put.
– Rod
the question url works, but I wanted this http://localhost/wpcurso/exercicios-questoes/1 to work.
– Rod
Test this: Rewriterule . /wpcurso/index.php/$1 [L]
– Lucas Antonio
with php and htacess could do normaemnte, but it seems to be a page inside the worpress and using Template Name: exercises-questoes maybe you have to do something different, I don’t know.
– Rod
try to do what I sent you up on htaccess
– Lucas Antonio
I’m out of access now, tomorrow I’ll be, but it won’t interfere with wp? native pages categories, for example?
– Rod
Go not, it looks like you’re using the Wordpress route if using /name think will, need to configure to receive id, if it is giving error.
– Lucas Antonio
for now just id to test, then I will insert the string id-xxxxxx but there is quiet.
– Rod
if you put what I passed to Htaccess is already right..
– Lucas Antonio
was trying something like exercise-questoes/([0-9]) exercises-questoes/? id=1$
– Rod
Thanks man, tomorrow I’ll test.
– Rod
if you use it as I said it will be exercises-questoes? id=1
– Lucas Antonio
Let’s go continue this discussion in chat.
– Rod
it works not, actually it gives error 500 if you insert this rule in htacess.
– Rod
Then moio kkk, makes a plugin for this and passes a shortcode next to the page I create requesting the ID in the URL
– Lucas Antonio