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
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?
– Woss
@Andersoncarloswoss Yes, I did use his example to build the rule
RewriteRule ^stream\/(.*)$ /pages/stream.php?a=$1
, so much so that when I accesssite.com/stream/algo
it works perfectly, but when I accesssite.com/outra
doesn’t work.– Lucas Caresia
When I change the rule
RewriteRule ^index.php\/(.*)$ pages/$1.php
forRewriteRule ^(.*)$ pages/$1.php
the pagesite.com/outra
starts to work, butsite.com/stream/algo
to work together withsite.com
(index php.).– Lucas Caresia
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.
– Lucas Caresia
Maybe. You are no longer using the
index.php
that you defined here?– Woss
No, my index is completely empty. I created a project just for testing, so my doubts.
– Lucas Caresia
https://answall.com/a/202943/5878
– Woss