Rewrite rule for custom category in a theme, how to change URL addres
-
I want to change the url of my wordpress, I have read that I can make that with rewrite rule but it does not work me unfortunately. Here are the details:
I have a wordpress theme, which got me that kind of URL:
www.my-theme.pl/portfolio_category/red-flower/
I want to rewrite the URL via .htaccess to receive:
www.my-theme.pl/gardens/red-flower/
As you see, I just want to replace /portfolio_category/ with /gardens/ text in the URL.
I entered this rule:
RewriteRule ^/portfolio_category/$ /gardens/$ [NC]
And it does not work unfortunately. Can you clarify how to use properly ?
Below is my entire .htaccess code:`Options -Indexes
AuthType Basic
AuthName “password”
AuthUserFile /home/*******************/.htpasswd
Require valid-user# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/portfolio_category/$ /gardens/$ [NC]
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</IfModule>
# END WordPress`The ******* are replaced with working path to my htpasswd.
It is my first time to make any rewrite changes and I am not familiar with it. I think I have read the tutorials correctly but the change still does not work.Best regards from Poland,
Jacek
- The topic ‘Rewrite rule for custom category in a theme, how to change URL addres’ is closed to new replies.