简体   繁体   中英

.htaccess - Rewriting results in a 500 internal server error (ODD)

I know this is a "popular" question but i'm rather sure my .htaccess file is allright. However, it still results in a 500 internal server error and i'm wondering how to fix it.

RewriteEngine on
CheckSpelling on

RewriteCond %{REQUEST_URI} !^pages/
RewriteRule ^(.*)$ pages/$1 [L]

I want to 'hide' the folder "Pages" from the URL so users can just navigate to domain.com/mypage instead of domain.com/pages/mypage .

Without the RewriteCond and the RewriteRule the .htaccess file works.

Thanks for your time!

I assume your Apache Webserver has not mod_speling enabled. Your htaccess looks fine.

Try remove the line CheckSpelling on if it is not necessary or install mod speling and enable it with a2enmod speling

As Hiren patel allready pointed out, check that mod rewrite is enabled too. a2enmod rewrite

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM