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

0

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

/ example (can)

/ example / (can)

/ example / any_thing ( can not )

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



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

My current code or skip everything after the bar, or just work with the bar. Am I lousy with .htaccess can you help me?

    
asked by anonymous 19.07.2017 / 06:18

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]
    
19.07.2017 / 07:47