I need to rewrite every file in my .htaccess from .php to a clean URL without it, but I can't make it work.
My current code is the following:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteCond %{THE_REQUEST} !/(blog)\.php
RewriteCond %{THE_REQUEST} \.phP
RewriteRule ^(.*)\.php$ /$1 [R=301,L]
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^url.info [NC]
RewriteRule ^(.*)$ https://www.url.info/$1 [L,R=301]
Redirect 301 /url1.php /url2.php
ErrorDocument 404 /404.php
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 6 months"
</IfModule>
# Deflate Compression by FileType
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-shockwave-flash
</IfModule>
# Deflate Compression by MimeType</span>
<IfModule mod_deflate.c>
<FilesMatch ".(js|jpg|jpeg|gif|png|css|txt|html)$">
ExpiresActive on
ExpiresDefault "access plus 1 month"
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
When I want to access URL1 it gives a 404. It works by itself and with everything else but not when I add the php part at the beginning. I hope you can help me, thank you .