Hi
There is a lot of info on https://codex.ww.wp.xz.cn/Using_Permalinks page
You can focus on “Automatically updating .htaccess” if you want, since it may automatize your process.
I hope that helps.
If you have more questions, please reply
Hi pedger,
thanks for the answer, but unfortunately I am not a tech guy… I am more a “copy/paste solution user”…
I’ve seen in many threads how people explain how to do to the opposite I ask (going from %category%/%postname% to %postname%) and give some rewrite rules that should be added to the .htaccess file, so I am more looking forsomething like that or an easy alternative I can apply.
I have close to 0 knowledge of php and a blog with more than 2000 posts that now gives 404 errors for the %postname% permalinks… :/
I can do the redirect manually using a redirect plugin, but it ask to add each post url I want to redirect and it will take me ages.
well… can you paste here the contents of your .htaccess? please do it with the “code” tag above the editor.
Here, mine looks like this:
Options +FollowSymLinks -SymLinksIfOwnerMatch
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-raw/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp-raw/index.php [L]
</IfModule>
# END WordPress
Also, do you know what kind of webserver are you using? Apache? Nginx? This is important because to make custom permalinks work, you have to setup the webserver to accept this kind of redirects.
For now, you can use the default permalink (that one that looks like http://YOURSITEHERE/?p=123) and your blog should work again.
Hello again and thank you for your time.
Here’s how the .htaccess of my site looks like
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-javascript application/javascript text/javascript text/css
<FilesMatch “.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>
ExpiresActive On
ExpiresDefault “access plus 1 year”
</FilesMatch>
Header unset ETag
FileETag None
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
The webserver is Apache (I assume it’s Apache, the site is hosted in Bluehost).
As for the redirection. I like the new permalinks structure I have with /category/post. My problem now is how to fix the redirection for the old one (/post), that now gives 404 errors.
Thanks
Anyone? 🙂 I am still trying to figure out how to apply the redirection in my .htaccess from:
domain/%postname%
to:
domain/%category%/%postname%
Thanks