Jump to content

htaccess help please


jokerfool

Recommended Posts

My host recently updated to php5 and I am having some issues on my site.

 

When a user visits a link e.g. blahabc.com/abc they're referred automatically to my default 404 page, thus the user now has to add the index.php extension after abc making it blahabc.com/abc/index.php

 

Now in my htaccess file is it possible to write something in there so when a user goes to blahabc.com/abc they're redirected to blahabc.com/abc/index.php?

 

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/91028-htaccess-help-please/
Share on other sites

If a user goes to the wrong path or even a path with just a folder .com/abc then at the moment they're redirected to my default 404 page which is fine.

 

What I wont to know is in the .htaccess file is there a command I can add so if a user goes to .com/abc then they're redirected automatically to .com/abc/index.php and not sent to the 404 page?

Link to comment
https://forums.phpfreaks.com/topic/91028-htaccess-help-please/#findComment-466590
Share on other sites

But if I want the user to go to domainname/software and want the contents of the software folder to load how do I do this in the htaccess file?

 

Do I add Directory Index software/index.php

 

Because since the host updated to php5 when i go to domainname/software I get redirected now to my default 404 page, which is not what I want. If I want to load the contents of the software folder I now have to type in domainname/software/index.php

 

I want to know if there is a shortcut I can place in the htaccess file so if a user does just go to domainname/software then it will load the contents because the htaccess file says something like " If user visits domainname/software* >> domainname/software/index.php

 

Possible?

Link to comment
https://forums.phpfreaks.com/topic/91028-htaccess-help-please/#findComment-468150
Share on other sites

Directory Index index.php

 

put it here

 

domainname/software/.htaccess

 

Now when someone goes to http://domainname/software they will be shown index.php

 

At least that's how it should work.  You should'nt even need this as it's usually default.

Link to comment
https://forums.phpfreaks.com/topic/91028-htaccess-help-please/#findComment-468205
Share on other sites

Directory Index index.php

 

put it here

 

domainname/software/.htaccess

Directory Index needs to be one word:

DirectoryIndex index.php

 

However I would recommend you to have a word with your hosts about this though. Maybe they forgot to add index.php to the DirectoryIndex.

Link to comment
https://forums.phpfreaks.com/topic/91028-htaccess-help-please/#findComment-468274
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.