How to I redirect URLS with special characters in htaccess?

Let’s learn how to I redirect URLS with special characters in htaccess. The most accurate or helpful solution is served by Server Fault.

There are ten answers to this question.

Best solution

htaccess Redirect / RedirectMatch with URLs that contain Special / Encoded Characters

I'm currently in the process of applying a variety of 301 redirects in an .htaccess file for a website that recently changed its structure. Everything is working as expected, except for URLs that contain special characters, for these I am getting 404 errors. For example the following directives that have a registered trademark symbol (®) bring up 404 pages: RedirectMatch 301 ^/directory/link-with®-special-character(/)?$ somelink.com RedirectMatch 301 ^/directory/link-with%c2%ae-special-character...

Answer:

I can confirm that those two attempts at RedirectMatch fail on my apache installation as well, even...

Read more

dSquared at Server Fault Mark as irrelevant Undo

Other solutions

How do I redirect a set of URLs with regular expressions in .htaccess for a wordpress installation?

Just transfered my site from Drupal to WordPress. Generating a lot of 404's for URLs that don't exist, probably from spam bots. For example /comment/reply/123 or some other ...show more

Answer:

Looks like a similar problem was solved here: http://www.webmasterworld.com/apache/400... I am sure...

Read more

ODD4ZODJ777RH7C2XYS73CXCRI at Yahoo! Answers Mark as irrelevant Undo

htaccess multi-domain redirect issues

I have .htaccess rewrite/redirect problems. What makes this more frustrating is that it is such a simple situation. I am doing a favour for a friend, the kind of favour that you soon wish you'd never got involved with and left for a professional to sort...

Answer:

If you just want to match the root only, then you want RewriteRule ^$ en/ [R]. You don't even need the...

Read more

The Discredited Ape at Ask.Metafilter.Com Mark as irrelevant Undo

Using RedirectMatch with URLs containing question marks.

RedirectMatch, mod_rewrite, and question marks, oh my! Please help me redirect to urls with question marks in them. I've got a web site hosted on an apache server, I'm not a Unix guy, and I need some syntax help. I would like to redirect a list of urls...

Answer:

Ohh... I didn't see that it was in an .htaccess file. All the rewrite rules work diferently inside ...

Read more

i love cheese at Ask.Metafilter.Com Mark as irrelevant Undo

Permanently redirecting more than 6k pages to a brand new url scheme: htaccess or http redirects?

We are moving a site that was built directly in html to a new wordpress cms. Since the site depends largely on google searches it's fundamental not to lose the previous links. But here's the kicker: All old URLs were built in a random manner, he simply...

Answer:

You should go in Google and type site:your-domain.com and manually redirect each of the page indexed...

Read more

Razvan Girmacea at Quora Mark as irrelevant Undo

How do I redirect subfolder URLs to subdomain URLs?

Apologies for asking a question that I know will be answered already on the web, somewhere, but I can't find it. I'm having trouble writing a .htaccess ReWrite rule that will forward requests for all folders within a specific sub-folder to the same folders...

Answer:

Geez, you will have to excuse my horrible typing. That '3-1' should be '301'.

Read more

Cobbler at Ask.Metafilter.Com Mark as irrelevant Undo

In need of an htaccess redirect code?

I just converted my forum to run on a different script. My old URLs had .htm extentions, like this: http://www.mysite.com/my-page.htm However, my new urls now look like this: http://www.mysite.com/my-page/ How can I remove the slash, and replace it with...

Answer:

For just this instance, something like this would work redirect 301 /my-page.htm /my-page/ If you'd...

Read more

CSt99 at Yahoo! Answers Mark as irrelevant Undo

What is the proper way to mask/redirect a URL with mod_rewrite using .htaccess?

I have a website example.com and the former method for accessing pages was example.com/TG/?nav=XXXX and I have switched the directory to example.com/?nav=XXXX. How do I still have all those old links with the TG/ still go to the new URLs? Different question...

Answer:

Create the .htaccess file with the following content at the webroot of your domain (usually the directory...

Read more

Sayan Chakrabarti at Quora Mark as irrelevant Undo

Re 301 page redirect

Our company has it web site listed in google, we have how taken over one of our retailers but this now means we have 2 web sites on different servers and urls, listed in google both with similar content and now with the same postal addresses. To sort...

Answer:

Hello evergreensuk-ga! This tutorial by Michael Bloch for "Taming the Beast" talks specifically...

Read more

evergreensuk-ga at Google Answers Mark as irrelevant Undo

Redirect users to different websites depending on password and username given?

Hello, Does anybody know of a good tutorial on using .htaccess to redirect users to different urls depending on what username and password they provide? I keep seeing tutorials on how to do each of these separately (ie password protecting folders OR...

Answer:

Not sure about the password, (afterall, this could change!) but redirecting based on the username wouldn...

Read more

Skinny Latte at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.