I'm kind of new to PHP. I wanted to know how to get my site to open in it's original url ie: http://blah4site.com/name instead of http://blah4site.com/name/index.php or having a slpash page and then going into the http://blah4site.com/name/index.php, when someone first visits the site. I hope this isn't too confusing. Here is an example site: click See how her's opens to the original url and then if you hover over 'main' it takes you to http://www.lunaestas.com/savvy/index.php. So this must happen somewhere within the php file? How do I do this?

Recommended Answers

All 7 Replies

Try to put it in .htaccess file.

Redirect /name/index.php http://blah4site.com/name

It's not tested yet. Please let me know the results.

Put what in the .htaccess?

Sorry did not make clear. Put the below code in .htaccess

Redirect /name/index.php http://blah4site.com/name

I tried it this way Redirect /name/ http://blah4site.com/name/index.php and I got redirection URL has exceeded its limit and said it may be caused by cookies that are being blocked. Nothing happened with the code the other way.

Try alternative code.

put the below code in top of index.php

if($_SERVER['REQUEST_URI'] == "/name/index.php"){
	header("Location: http://blah4site.com/name/");
}

nope, didn't do anything.

I found how to do it. Thanks for all your help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.