I can’t reach my sub page by passing friendly url

Asked

Viewed 95 times

0

O . htaccess

RewriteEngine On
RewriteRule ^imagine/([^/]+)/([^.]+)$ ver_imaginew_agora.php&id=$1&titulo=$2
RewriteRule ^portifolio/([^/]+)/([^.]+)$ ver_portifilio.php&id=$1&titulo=$2

How I pass the link

<a href="portifolio/<?php echo $lista['id']; ?>/<?php echo $lista['titulo']; ?>">

he can’t find the page that’s there.

  • Be careful when mounting the URL as $lista['titulo'] has to be prepared to compose a URL, that is, without accents, spaces, symbols such as ?, !, >, &, etc.

1 answer

0

There is an error after the filenames, instead of using&after.php, '?' should be used. After the first parameter, '.php' is used '&'.

Below is the correction:

RewriteEngine On
RewriteRule ^imagine/([^/]+)/([^.]+)$ ver_imaginew_agora.php?id=$1&titulo=$2
RewriteRule ^portifolio/([^/]+)/([^.]+)$ ver_portifilio.php?id=$1&titulo=$2
  • It was too much!!! Thanks, I just wanted to know how I put the link to go back inside a normal page .. for example.. there it is . <a href="index.php">back</a> and it’s going like this.. http://www.imaginew.com.br/imagine/9/Envelopamento%20de%20Ve%C3%Adculo%20-%2012/11/index.php

  • In this case you have to put a bar before index.php so that the browser understands that you want to go to the index.php page from the root of the site. Try replacing your link with <a href="/index.php">back</a>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.