Add a Trailing Slash to Single Url

0

Hi I Want to Add Trailing Slash to (/) only a Single URL

The URL I want to add trailing slash is http://niresh12495.com/index.php so it would look like http://niresh12495.com/index.php/ any htaccess ideas?

I have tried to add trailing slash to all urls but that caused an issue, example:

niresh12495.com/topic/sometopic/page2/ was redirected back to niresh12495.com/topic/sometopic/ so there is no way to see the next page it will always redirect to main topic

The KingMaker

Posted 2014-02-13T14:29:49.363

Reputation: 103

You can just use RedirectMatch 301 ^/(index\.php)$ /$1/ as your first rule. – anubhava – 2014-02-13T17:21:36.313

Answers

1

If the last character on a multi-level filepath is a forward slash, that indicates that the previous name was a directory, not a file. If you really want index.php to represent a directory and not a file, then you would have to create a directory with that name on your server. Then, the htaccess could be modified to omit *.php as a file type, and you could mis-use some other file extension as a default web page type.

Basically, not a good idea. Maybe if you explain what you are trying to do after you are able to add a trailing slash to a filename, someone could offer you a better alternative.

jdh

Posted 2014-02-13T14:29:49.363

Reputation: 6 645

The Reason For Which I'm Asking is i have set up /index.php/ to redirect to root / but it was not possible with /index.php & if i try to rewrite index.php that turns out to be a nightmare because it messes with login & everything around the forum Thanks for this information :) – The KingMaker – 2014-02-13T18:22:18.563