Problems with 301 Redirects in .Htaccess file


#1

Hello all,

I’m pretty new to anything to do with code, and I’m having a problem getting 301 redirects to work for me. I have tried all of the wordpress plugins and none have worked. Every redirect I try to do simply sends the link to my home page.

I am currently trying to redirect http://www.littlecoffeefox.com/#!Creating-a-Cleaning-Calendar-in-the-Bullet-Journal/c21x6/574239950cf26572082b9fc1
to
http://littlecoffeefox.com/2016/06/12/309/

I currently have the following in the .Htaccess file:

[code]# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^#!Creating-a-Cleaning-Calendar-in-the-Bullet-Journal/c21x6/574239950cf26572082b9fc1$ http://littlecoffeefox.com/2016/06/12/309/ [R=301,L]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

END WordPress[/code]

I have also tried:

[code]# User added 301 Redirects
Redirect 301 /#!Creating-a-Cleaning-Calendar-in-the-Bullet-Journal/c21x6/574239950cf26572082b9fc1 http://littlecoffeefox.com/2016/06/12/309/

End User added 301 Redirects

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress[/code]

Every thing I try ends up with the page simply redirecting to my homepage. I greatly appreciate any assistance you can offer.

Thanks in advance!


#2

Hi, I’m new to coding too if you cant find an answer here you can also try to get some help at stackoverflow.com. Im not sure if your problem is directly related to dreamhost servers if it is i would suggest opening a ticket then with dreamhost.


#3

The part of the URL delimited by the # is called a fragment/anchor and is not provided to the web server as part of the request. It is used by the web browser to access a particular section of a web page once it has loaded.

In otherwords, the browser requests the following from the server:

GET / HTTP/1.1[CRLF] Host: www.littlecoffeefox.com[CRLF] Connection: close[CRLF] User-Agent: Web-sniffer/1.1.0 (+http://web-sniffer.net/)[CRLF] Accept-Encoding: gzip[CRLF] Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF] Cache-Control: no-cache[CRLF] Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]

Since the server does not see the fragment “Creating-a-Cleaning-Calendar-in-the-Bullet-Journal/c21x6/574239950cf26572082b9fc1” in a header, you cannot develop a rule to match.