Htacess rewrite does not open index

Asked

Viewed 31 times

-1

Hi, have this .htacess

RewriteEngine On
RewriteBase /

RewriteRule ^(css|images|js|fonts) - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+?)/?$ $1.html [L]
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule (.*) http://%1/$1/$2 [R=301,L]
RewriteRule ([a-z0-9]+)/([a-z0-9]+)$ PDOClasses/Pages/checkurl.php?param1=$1&param2=$2 [L,QSA]
RewriteRule ([a-z0-9]+)/([a-z0-9]+)/$ PDOClasses/Pages/checkurl.php?param1=$1&param2=$2 [L,QSA]
RewriteRule ([a-z0-9]+)$ PDOClasses/Pages/checkurl.php?param1=$1 [L,QSA]
RewriteRule ([a-z0-9]+)/$ PDOClasses/Pages/checkurl.php?param1=$1 [L,QSA]

I can’t access the index.php 'cause it throws me to checkurl.php what I did wrong in the rules?

1 answer

0

Try to do this way using Rewriterule and inserting ^(.*)$ / accompanied by the index.php. Then you can adapt it.

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA]

Browser other questions tagged

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