jarus
jarus

Reputation: 1873

how to htaccess rewrite and url with whitespace?

I am trying to write a htaccess redirect for a url from the old site to the new website the old url has whitespace in the url link, I tried

    RewriteCond %{REQUEST_URI} ^/office%20coffee/officecoffee.html [NC]
RewriteRule (.*)  /coffee/portion-packs.html  [R=301,NC,L] 

but it doesnot redirect, what would be a solution to this.

Any help will be greatly appreciated, thanking you in advance.

Upvotes: 1

Views: 113

Answers (1)

anubhava
anubhava

Reputation: 785128

Replace your 2 line with this one:

RewriteRule "^office coffee/officecoffee.html$" /coffee/portion-packs.html  [R=301,NC,L]

Upvotes: 1

Related Questions