Forum Moderators: phranque
www.example.com/page1
www.example.com/#!ajaxpage1
RewriteRule ^page1$ "http\:\/\/www\.example\.com\/page1" [R=301,L]
RewriteRule ^#!ajaxpage1$ "http\:\/\/www\.example\.com\/\#\!ajaxpage1" [R=301,L]
Here is a normal procedure
<snip>
"http\:\/\/www\.example\.com\/page1"
Each URL that contains a hash fragment beginning with the exclamation mark is considered a #! URL. Note that any URL may contain at most one hash fragment. Each pretty (#!) URL has a corresponding ugly (_escaped_fragment_) URL, which is derived with the following steps:
1. The hash fragment becomes part of the query parameters.
2. The hash fragment is indicated in the query parameters by preceding it with _escaped_fragment_=
3. Some characters are escaped when the hash fragment becomes part of the query parameters. These characters are listed below.
4. All other parts of the URL (host, port, path, existing query parameters, and so on) remain unchanged.
RewriteRule ^page1$ http://www.example.com/page1 [R=301,L]
RewriteRule ^#\!ajaxpage1$ http://www.example.com/somepage [R=301,L] www.example.com/page#fragment the browser requests /page from www.example.com and when the page is delivered the browser visually auto-scrolls down to the named anchor or id "fragment" part of the page. www.example.com/somestuff?_escaped_fragment_=ajaxpage. www.example.com/#!ajaxpage the browser requests /?_escaped_fragment_=ajaxpage from www.example.com RewriteCond %{QUERY_STRING} (^|&)_escaped_fragment_=ajaxpage(&|$)
RewriteRule ^$ http://www.example.com/somepage [R=301,L]
are you saying that the following will work?