0

Whenever I go to a page, like payment.php,the URL always become www.website.com/public_html/payment. I don't have any .htaccess anymore in both public_html and the root.

This happened after I tried using this, and even if I deleted my .htaccess, it still adds public_html in the URL.

This is the rules that I added (I already deleted the file so I'm expecting that no rewriting should happen anymore):

# Remove .php extension
RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.php
RewriteRule (.*)\.php$ /$1/ [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/(.+)/$
RewriteCond %{DOCUMENT_ROOT}/%1.php -f
RewriteRule ^(.*)/$ $1.php [L]

# Force trailing slash
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule .*[^/]$ $0/ [L,R=301]

How to revert it back to the default?

Note: I don't really know much about this, so please comment for what other info should I add

Carl Binalla
  • 5,393
  • 5
  • 27
  • 46

1 Answers1

2

The link you provided shows that the .htaccess file served the responses as 301 redirects which is cached by browsers. You can try a simple browser restart to see if that fixes the problem.

Otherwise, you might find relevant information here:

How long do browsers cache HTTP 301s?

kmdm
  • 143
  • 7
  • I restarted chrome, but still the rewriting happens. So I tried opening it in firefox, and it does not happen there. So I guess it is cache after all – Carl Binalla Nov 23 '17 at 09:49
  • The cache is permanent. For Chrome, from the linked article, you can try: To clear a permanent redirect, go to chrome://net-internals. On the right of the top red status bar, click on the down arrow ▼ to open the drop-down menu, and under the "Tools" group, choose "Clear cache". – kmdm Nov 23 '17 at 10:57