How to rewrite a URL using htaccess?

How can I redirect a url using htaccess?

  • Greetings, I just noticed that in my source box here on Answers, the URL I originally pasted in the box was changed from http://www.mysite.com/thispage.html to http://mysit… , where the link ends in a special ellipsis character (all three dots are a single character). The issue of non-www versus www links is not a problem, but having the back of the link trimmed is an issue - and what I know about htaccess redirects is minimal. I can edit the links in open posts to ensure they work as intended, but those in voting or resolved cannot be edited, and return a 404 error to anyone attempting to browse to the page. So what I'm looking for is a way to redirect a link with an 'odd' ellipsis terminator (but which should have terminated with an html / page designation) - and actually get the visitor to the intended page. Thanks in advance for any suggestions.

  • Answer:

    The format would be: redirect 301 /thispage... http://www.mysite.com/thispage.html I'm not sure if/how it will handle elipses - never had that one before. Also, the actual domain will need to be present or the user will never get to the site for the htaccess to work. I included links to a couple of resources I use to reference the syntax. Good luck!

Hydroace at Yahoo! Answers Visit the source

Was this solution helpful to you?

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.