简体   繁体   中英

pretty links using htaccess

I have a wordpress site and i use some custom pages...in one of that pages i use this url to show content:

http://www.formacao.com.pt/formacao/?id=87&nome=excel-2013-macros-e-vba/

and i want that the url looks like this:

http://www.formacao.com.pt/formacao/87/excel-2013-macros-e-vba/

If someone could help me should be great...

Assuming you are using Apache and have mod_rewrite installed and enabled, this should work.

Redirect 301 http://www.formacao.com.pt/formacao/?id=87&nome=excel-2013-macros-e-vba/ http://www.formacao.com.pt/formacao/87/excel-2013-macros-e-vba/

HTH!

=C=

Just check [this tutorial][ http://codex.wordpress.org/Using_Permalinks] from the Wordpress Codex to activate mod_rewrite on your .htaccess file for Apache or with Nginx. You'll have beautiful PATHINFO links!

TL;DR

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

in your .htaccess file (for Apache).

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