homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

how to redirect ajax to wordpress
how to redirect ajax to wordpress

Msg#: 4618759 posted 7:46 am on Oct 24, 2013 (gmt 0)

Hi Guys,

It has been three days i've been trying to redirect ajax url to wordpress. i've tried almost everything but nothing seems to work.
i want to redirect: example.com/#!about3/c1uy6 to example.com/about-us/

we need to do it as soon as possible because most of the pages are indexed by google.
Thanks in advance.

[edited by: bill at 8:53 am (utc) on Oct 24, 2013]
[edit reason] use example.com for URLs [/edit]



WebmasterWorld Administrator 5+ Year Member

Msg#: 4618759 posted 11:56 am on Oct 24, 2013 (gmt 0)

Could you post a few examples of what you have tried?

NOTE: In examples, replace your domain name with example.com


Msg#: 4618759 posted 4:25 pm on Oct 24, 2013 (gmt 0)

Hi aakk9999,

i've tried the following codes:

RewriteCond %{QUERY_STRING} (^|&)_escaped_fragment_=about3(&|$)
RewriteRule ^$ http://www.example.com/about-us/ [R=301,L]

and i've tried 301 redirect too with no escape.

[edited by: phranque at 4:58 pm (utc) on Oct 24, 2013]
[edit reason] disable graphic smile faces [/edit]


WebmasterWorld Administrator 10+ Year Member

Msg#: 4618759 posted 8:16 pm on Oct 24, 2013 (gmt 0)

In my experience the "#!about3/c1uy6" part of the URL will not even be sent to the server (at least its not in Firefox). So a standard mod_rewrite will not work in this case.


WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4618759 posted 8:07 am on Oct 25, 2013 (gmt 0)

On a non-ajax site a straightforward request for
example.com/#!about3/c1uy6 will result in a GET / HTTP/1.1 request to the server with the browser expecting to find an in-page named anchor called !about3/c1uy6 to scroll down to.

Search engines will not treat
example.com/ and example.com/#!about3/c1uy6 as duplicate content. They will treat them both as being the root home page.

In this case, the OP wants a request for the old Ajax URL to redirect to a different place. The only way this can be done is by ensuring there is some javascript on the root home page that can detect the
#!about3/c1uy6 part in the browser address bar and then act on it.

This javscript could simply cause the browser to make a new request for the new URL, or it could send an Ajax-like request to the server that causes it to issue a proper 301 redirect. Which one you do depends on whether this is for visitors using a browser or for search engines as well.

In any case, your pattern ending
about3(&|$) would never match the URL request given in the example as there's /c1uy6 following.

Msg#: 4618759 posted 4:37 pm on Oct 26, 2013 (gmt 0)

Thanks g1smd. I'll try to redirect it using javascript.

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