简体   繁体   中英

Htaccess rewrite links doesn't work in .htaccess file

I have a website and I tried to rewrite links using htaccess file but the rewrited link does not work. The original link is like this :

http://my-website.com/open?cours=3em-tricks

I want to rewrite it to this form:

http://my-website.com/tuto/cours/3em-tricks/

In the .htaccess file I write this code:

RewriteEngine On
RewriteBase /
RewriteRule ^tuto/cours/(.*)$ open?cours=$1 [N]

But I always get the 404 page in rewrited link. Note the the htaccess module is activate on server.

Maybe it's the trailing slash and the N .

RewriteEngine On
RewriteBase /
RewriteRule ^tuto/cours/(.*)/?$ open?cours=$1 [L]

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