简体   繁体   中英

.htaccess rewriterule all links

I'm trying to replace 'account/Username' / 'account/Username/' into 'account?account=Username'.

This is my current .htaccess, on the end of this script are 3 rules, I tried to create this rewriting by myself but not with any luck... Can you guys see what's the problem? (Sorry for being noob, I've no experience in .htaccess docs)

Options -Indexes +FollowSymlinks
Header add Access-Control-Allow-Origin "*" 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ ./index.php?request=$1

ErrorDocument 500 /index.php?request=error
ErrorDocument 404 /index.php?request=error
ErrorDocument 403 /index.php?request=error

RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?url\.nl$ [NC]
RewriteRule ^$ https://url.nl%{REQUEST_URI} [R,L]
RewriteEngine Off

RewriteEngine On
RewriteCond %{HTTP_HOST} account
RewriteRule ^account/(.*)$ https://url.nl/account?account=$1

我正在使用TPL引擎,这就是为什么它不起作用的原因。

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