Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

sEnte

HTML echo

Recommended Posts

sEnte

Tenho este simples código. HTML

<?php 

  $url = $_GET['url'];

  echo $url;

?>

e tenho uma .htaccess

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

Porque é que se colocar 127.0.0.1/cenas/coisas aparece print 'coisas' na paǵina, se no link escrever index já me aparece o seguinte erro "Notice: Undefined index: url in /var/www/html/cenas/index.php on line 3"

está a adiconar o .php


"If It Ain't Broke, Break it and build something Cooler!" Unknown

Share this post


Link to post
Share on other sites
chbcl

Experimenta:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

 


developer @ filipealves.net

filipealvesbcl [a] gmail.com

github.com/filipealvesbcl

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.