How to release a URL and Query String level with or without via . htaccess and others have an error 404?

Asked

Viewed 119 times

0

With . htaccess I need to release a url level to block the others with error 404 being:

/example (can)

/example/ (can)

/example/anything (can’t)

RewriteEngine On
RewriteRule %{REQUEST_FILENAME} !-f
RewriteRule %{REQUEST_FILENAME} !-d



RewriteRule (^.*)$ index.php?piada=$1 [QSA,L,NC]

My current code or let it all go past the bar, or it only works with the bar. I’m terrible with . htaccess can help me?

1 answer

0

Solved with the following code:

RewriteEngine On
RewriteRule %{REQUEST_FILENAME} !-f
RewriteRule %{REQUEST_FILENAME} !-d

RewriteRule ^(.[a-z0-9-]+/?)$ index.php?piada=$1 [QSA,L,NC]

Browser other questions tagged

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