简体   繁体   中英

.htaccess Rewrite mod not working

I'm trying to get my htaccess file to use this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

to rewrite this url:

http://cheesecakebb.org/index.php?action=vn

Try this instead:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^index/([^/]+)/?$ index.php?action=$1 [QSA,L]

When someone clicks example.com/index/something , it will redirect (invisibly to the user) to index.php?action=something

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