FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Another simple redirect code, please help





Da Rossa
Hi, I have this site: http://notasdeaula.org

Some day in the past someone helped me writing this piece of .htaccess file with a regex I just can't understand:

Code:
RewriteEngine on
RewriteRule ^([a-z]+)$ /$1.html [NC,R=301,L]


So everytime someone access a page in my site forgetting the .html extension/suffix then it will correct automatically adding the .html end.

Now, I'd like to do something even simpler: in my root directory there are many pages. two of them are:

http://notasdeaula.org/index.html
and
http://notasdeaula.org/8.html.

The index.html is the page accessed, like expected, when someone accesses the site by it's domain name, notasdeaula.org. What I want to do is to create another .htaccess file, or another solution that doesn't conflict with that already existing .htaccess so, when someone types in http://notasdeaula.org, then s/he will be autoredirected to http://notasdeaula.org/8.html.

How can I do that?

Thanks in advance Smile
Relentless
Tested:

Code:

RewriteEngine on
RedirectMatch "/index.html" http://notasdeaula.org/8.html


But why not just usee this in your index.html header:

Code:

<meta http-equiv="refresh" content="0;URL=/8.html" />


Hope I have helped

Dan
Da Rossa
Man, I never realised it was even simpler than I thought, thanks a lot! Smile

Edit: almost forgot to tell what I did Razz

I used your second suggestion. Just added the

Code:
<meta http-equiv="refresh" content="0;URL=/8.html" />


...along with other <meta> tag in the header. I never used it before Smile
menino
Thios is nice useful info. Thanks relentless.
lightwate
Thanks, this helped me out too..

So that's what the .htaccess is for.
bruks
Redirect 301 /hello.html http://google.com
futurcat
bruks wrote:
Redirect 301 /hello.html http://google.com


I remember having a similiar problem in another hosting site. The solution was easily found through a google search.

If you cannot find it this time please ping it and I hope I can help you.

Best regards!
Related topics
simple php problem, please help...
Please help me!!!! HTML/Flash help needed!
Problem with MySQL Server Please Help!!
Help needed about this contact CGI file
THIS IS DRIVING ME INSANE!! PLEASE HELP!
Please help regarding editing of index file
Can someone please help me with my website?
Anyone please help me!
what is wrong with this query? Please please help!
Help! This small script has logical problems. Please help
Please help me give an advise to my friend
Please help about this..
Help With Simple PHP Code Snipit
Please Help I love 2 great Men
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.