0

I know that this is a stange question but i do not know the reason why my page is not loading the ".php" file when i access it with hxxp://url[dot]tld/file.php . To see the content i have to access it via hxxp://url[dot]tld/file.php/ . i know that i can do this from cpanel (redirects - section) but my provider has a customed panel and i found nowhere redirects option. I tried some codes from internet to redirect the old url to the new one via .htaccess but i m redirected to hxxp://url[dot]tld/file.php///////////////// or something like that.

edit: .htaccess content now

RewriteEngine on
RewriteCond %{HTTP_HOST} ^online\.my\-domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.online\.my\-domain\.com$
RewriteRule ^/?$ "http\:\/\/google\.com\/" [R=302,L]
//Rewrite to www
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} ^online.my-domain.com[nc]
RewriteRule ^(.*)$ http://www.online.my-domain.com/$1 [r=301,nc]


Redirect 301 /php-file-with-problems.php /php-file-with-problems.php/

How i said i m redirected to online.my-domain.com/php-file-with-problems.php//////////////

Adrian
  • 15
  • 5
  • Please update the question to show the relevant content from your .htaccess file. – Andy Jul 30 '16 at 02:26
  • Thank you , i just uploaded it! – Adrian Jul 30 '16 at 02:39
  • Please see if this answers your question: http://stackoverflow.com/questions/7780859/htaccess-rewrite-to-force-trailing-slash-at-the-end – Andy Jul 30 '16 at 02:46
  • Its working but not at all, when i access the url with atleast 1 slash its working, but when i access the url.tld/file.php without slash i got same problem. I will wait a little bit longer and come back with an answer. what is not cool is that when i access url.tld/file.php/ i m redirected to the url with many slashes ////////// like in first post. – Adrian Jul 30 '16 at 02:54

1 Answers1

0

Multiple slashes are being added to the filename by The redirect directive, and you are getting a redirect loop, to resolve this you will need to use RedirectMatch

RedirectMatch 302 /phpfile$ /phpfile/

Clear your browser cache before testing this.

Amit Verma
  • 40,709
  • 21
  • 93
  • 115