-1
所以我有鏈接這樣的友情鏈接:
mywebsite.com/index.php?sub=main
我想將其轉換爲
mywebsite.com/strona-glowna
所以我有鏈接這樣的友情鏈接:
mywebsite.com/index.php?sub=main
我想將其轉換爲
mywebsite.com/strona-glowna
你需要採取的htaccess的幫助。 創建名爲.htaccess 文件並粘貼此代碼有
AddDefaultCharset utf-8
Options +FollowSymlinks -Indexes
RewriteEngine on
RewriteBase/
# skip all files and directories from rewrite rules below
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule^- [L]
RewriteRule ^/([^/]*)\strona-glowna$ index.php?sub=$1 [QSA,L]
如果不嘗試幫助這個
RewriteRule ^strona-glowna/([A-Za-z0-9-]+)/?$ index.php?sub=$1 [NC,L] # Process parrots
兩者都不起作用:/ – m1u
試試這個我已經改變了 –
檢查本教程更換:https://code.tutsplus.com/tutorials/using-htaccess-files-for-pretty-urls - net-6049 – jetblack