0

I am new on this forum, I will appreciate a lot any help. I'm working on my website with PHP/MySQL in localhost and I am stuck on this clean urls problem.

This is my code

<a class="navbar_item" href="<?php echo BASE_URL;?>vender">Vender</a>
<a class="navbar_item" href="<?php echo BASE_URL;?>pages/comprar.php">Comprar</a>

This my .htaccess

ErrorDocument 404 /404.php
AddDefaultCharset UTF-8
Header unset ETag
FileETag None

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^vender pages/vender.php [NC]
RewriteRule ^vender pages/comprar.php [NC,L]

I have this urls: http://localhost/web/pages/vender.php and http://localhost/web/pages/comprar.php
And I want this clean urls: http://localhost/web/vender-piso and http://localhost/web/comprar-piso
But when I try to reach the url of the link, I get a 404 not found.

Alvaro
  • 1
  • 3
  • Well for a start having both rule patterns as the same things means only the first one will ever run since it's set as [L]ast. But you haven't actually asked a question, or told us what problem you're actually hitting. – Jonnix Aug 25 '19 at 21:11
  • Ok I removed the [L] from the first rule. When I try to reach the url of the link, I get a 404 not found. @Jonnix – Alvaro Aug 25 '19 at 21:19
  • Well yeah, since you don't want the second pattern to be vendor, do you. So put the `L` back in, change the second regex to e.g. `^comprar` or whatever it is you actually want to match. – Jonnix Aug 25 '19 at 21:54

0 Answers0