homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Problem with a simple htaccess 301 redirect
there is a quote mark in the referring url
master w bates III

 4:05 am on Mar 10, 2008 (gmt 0)

Hello again web master world.

I have just launched a site and it seems some doofus has linked to a non existent page on my site.

It's interesting because the link contains old text and a url with keywords in it from the article on the site. The page itself hasn't been indexed into an SE's yet. Odd.

So here is my current quandary.

I am getting a link to my site that looks like this.

http://www.example.com/fakedir/Keyword's from the article on my site.htm

and i would like to redirect it here


so i would think it would be as simple as

Redirect /fakedir/Keyword's%20from%20the%20article%20on%20my%20site.htm http://www.example.com/realdir/the-actual-article-on-my-site

It's just not working. Is there a correct way to do this?

thanks in advance :)

edit: also i should add that none of these directory's actually exist but are being created with mod rewrite. I would be working with the home directory htaccess.

[edited by: tedster at 8:40 pm (utc) on Mar. 27, 2008]
[edit reason] switch to example.com - it cannot be owned [/edit]


master w bates III

 4:29 am on Mar 10, 2008 (gmt 0)

Sorry for the bother. To other apache newbs like me, the solution is to put the string to be redirected in to double quotes and remove the url encoding.

so the redirect command that worked for me is:

Redirect "/fakedir/Keyword's from the article on my site.htm" http://example.com/realdir/the-actual-article-on-my-site

i hope this save some one a few more minutes then I have just spent learning that simple lesson.

[edited by: tedster at 8:40 pm (utc) on Mar. 27, 2008]


 12:38 am on Mar 11, 2008 (gmt 0)

You could pro-actively redirect more URLs with less work, if you use Mod-Rewrite code.

RewriteRule fakedir http://www.example.com/realdir/the-actual-article-on-my-site [R=301,L]

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved