Artur Haddad
Artur Haddad

Reputation: 1529

Redirect index.html to index.html#2

I was wondering if it's possible to make a redirect if the user types:

www.arturhaddad.com
automatically going to
www.arturhaddad.com/index.html#2

Tried the cpanel redirect function but it redirects me to http://www.arturhaddad.com/index.html%232

Any solutions?

Upvotes: 0

Views: 112

Answers (3)

soniccool
soniccool

Reputation: 6058

Put this in your index.html and it will redirect you to where you wanna go.

<meta http-equiv="refresh" content="0; url=LINK HERE" />

Upvotes: 0

Panama Jack
Panama Jack

Reputation: 24478

Yes it is possible. You can include it as a redirect. Use the NE flag to keep it from encoding it. Put this in your htaccess file.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?arturhaddad\.com$ [NC]
RewriteRule ^$ http://www.arturhaddad.com/index.html#2 [NE,L,R=301]

Also make sure to clear your browser cache before testing it or user another browser to check.

Upvotes: 1

Adrian Preuss
Adrian Preuss

Reputation: 3113

Mostly that will be maked over javascript. check over Javascript the location.hash variable and if that dont exists, you can make an redirect or a pushState to add these on the URL.

You can only make a redirect on servers side. You have no access (only over javascript) to check the location hash.

Upvotes: 1

Related Questions