Forum Moderators: phranque
These don't work in my htaccess:
redirect 301 "/WebDesignMontr%E9al" "http://www.mydomain.com/fr/design-web-montreal.php"
redirect 301 "/WebDesignMontréal" "http://www.mydomain.com/fr/design-web-montreal.php"
This currently triggers my 404
could anyone guide?
thanks!
RedirectMatch 301 /WebDesignMontr.{1}al http://www.example.com/fr/design-web-montreal.php
Which will match 'any character not the end of a line one time'. It's not exactly ideal, but the only way I know of to 'see' and match the encoding for sure is with THE_REQUEST in mod_rewrite, but you might get a match using the above and it doesn't make your redirect generic to the point where you would be matching incorrect locations.
Added: It appears mod_alias matches a %-decoded path, so your first redirect will not match, but the second may.
[httpd.apache.org...]
BTW: http://www.example.com does not auto-link here and cannot be owned, so it's usually the best example domain to use.
/WebDesignMontréal does not get redirected to
[mydomain.com...]
any more ideas?!
thanks!
http://www.example.com/WebDesignMontréal
No extension.
Not in a sub-directory.
Are there any sub-directories or pages? EG
http://www.example.com/WebDesignMontréal/Page
If there are no sub-directories / pages, and there is nothing else that would match after the first portion, you could try:
RedirectMatch 301 /WebDesignMontr.* http://www.example.com/fr/design-web-montreal.php
RedirectMatch 301 ^/WebDesignMontr.+al http://www.example.com/fr/design-web-montreal.php
If that doesn't work, see this recent thread on a more-complex solution using mod_rewrite: [webmasterworld.com...]
Jim