Error 404 while accessing file with . htaccess

Asked

Viewed 21 times

0

For now I’m with the following .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME}\.php !-d

RewriteRule ^index.php\/(.*)$ pages/$1.php
RewriteRule ^stream\/(.*)$ /pages/stream.php?a=$1
ErrorDocument 404 /pages/404.php

I have the following files

inserir a descrição da imagem aqui

When I access site.com/outra it returns error 404, how can I fix it?

  • It happens because the URL accessed does not match any pattern defined in the file. You even studied this answer?

  • @Andersoncarloswoss Yes, I did use his example to build the rule RewriteRule ^stream\/(.*)$ /pages/stream.php?a=$1, so much so that when I access site.com/stream/algo it works perfectly, but when I access site.com/outra doesn’t work.

  • When I change the rule RewriteRule ^index.php\/(.*)$ pages/$1.php for RewriteRule ^(.*)$ pages/$1.php the page site.com/outra starts to work, but site.com/stream/algo to work together with site.com(index php.).

  • There I had the doubt on how to use 2 arguments, here I want to know why of not being able to access files with htaccess, I think you are mistaken when the duplicate.

  • Maybe. You are no longer using the index.php that you defined here?

  • No, my index is completely empty. I created a project just for testing, so my doubts.

  • https://answall.com/a/202943/5878

Show 2 more comments
No answers

Browser other questions tagged

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