2017-02-10 84 views
-1

所以我有链接这样的友情链接:

mywebsite.com/index.php?sub=main 

我想将其转换为

mywebsite.com/strona-glowna 
+1

检查本教程更换:https://code.tutsplus.com/tutorials/using-htaccess-files-for-pretty-urls - net-6049 – jetblack

回答

0

你需要采取的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 
+0

两者都不起作用:/ – m1u

+0

试试这个我已经改变了 –