user930026
user930026

Reputation: 1657

.htaccess rewrite rule not working for different pages

I had the page name as the-book.html, but now i changed the page name to about-the-book. I have used the rewrite rule as

`Redirect 301 /the-book.html http://www.xxx.com/about-the-book.html`

but it is not working.

my full .htaccess code is here

RewriteRule ^/the-book.html$ http://www.xxx.com/about-the-book.html [R=301]

# 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

Upvotes: 0

Views: 510

Answers (2)

Shefali Aggarwal
Shefali Aggarwal

Reputation: 728

RewriteRule ^the-book.html$ http://www.example.com/about-the-book.html [R=301]

Upvotes: 1

Tarek Fadel
Tarek Fadel

Reputation: 1959

Not sure about the Redirect directive, but

RewriteRule ^the-book.html$ http://www.xxx.com/about-the-book.html [R=301]

should work nicely.

Edit: Removed the leading / in the match part.

Upvotes: 0

Related Questions