Home Rewriterule -> 500 internal error with .htaccess
Reply: 0

Rewriterule -> 500 internal error with .htaccess

user1092
1#
user1092 Published in April 22, 2018, 12:53 am

I tried everything for my problem, but nothing works.

I'm not familiar with regex, but I did my best.

Here is the code:

Options +FollowSymlinks

RewriteEngine on

RewriteRule ^series/([A-Z]+)?$ series.php?code=$1 [L,QSA,NC]
RewriteRule ^exercices/([A-Z]+)-([0-9]+)/([0-9]+)?$ exercices.php?code=$1&serie=$2&question=$3 [L,QSA,NC]

# Remove php extension
RewriteCond %{REQUEST_FILENAME}.php -f 
RewriteRule ^(.*)$ $1.php [L]

# Redirect to HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Redirect to 404 if url is not correct
RewriteCond %{THE_REQUEST} \s.+?\.php[\s?] [NC]
RewriteCond %{REQUEST_URI} !/index\.php [NC]
RewriteRule ^ https://www.test.com/404 [L]

# Errors
ErrorDocument 404 https://www.test.com/404
ErrorDocument 403 https://www.test.com/
ErrorDocument 500 https://www.test.com/

With that, I have a beautiful 500 internal error...

I've really did some research, but I'm still stuck.

Can someone help me please ? (sorry for my bad english)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320832 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO