0

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?

1

3 Answers 3

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Great job, how do i set it to arturhaddad.com too (it's working only for www.arturhaddad.com now)?
@ArturHaddad Ok see the update so it will match both.
1

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.

Comments

0

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" />

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.