0

i develop to remove .html .php, http://webrivers.co.in/joojmail_inbox this link work fine but cannot work subfolder http://webrivers.co.in/joojmail_inbox/joojdrive/, what i miss it.

my.htaccess code

RewriteEngine On
# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ http://webrivers.co.in/error/$1 [R=301,L]

# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ http://webrivers.co.in/error/$1 [R=301,L]

# Resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]

# Redirect external .html requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.html([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.html$ http://webrivers.co.in/error/$1 [R=301,L]

# Resolve .html file for extensionless html urls
RewriteRule ^([^/.]+)$ $1.html [L]

<IfModule mod_rewrite.c>
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /error/index.php [L]
</IfModule>
RewriteCond %{HTTP_USER_AGENT} ^HTTrack [OR]
RewriteCond %{HTTP_USER_AGENT} ^SiteSucker [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebZip [OR]
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.*$ no_download.html [L]

Please solve my problem.,

Lithilion
  • 1,097
  • 2
  • 11
  • 26
  • Do you mean remove the extensions? So that the file joojmail_inbox.php is run, but the URL just say joojmail_inbox? – random_user_name Mar 09 '18 at 04:37
  • i think you can find you answer [here](https://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – Rajeev Ranjan Mar 09 '18 at 04:38
  • sub folder files cannot run, redirect to error page @ Rajeev Ranjan –  Mar 09 '18 at 04:43
  • @cale_b joojmail_inbox is run but cannot run joojmail_inbox/joojdrive/index, sub folder file cannot run redirect to error page –  Mar 09 '18 at 04:45
  • Possible duplicate of [Remove .php extension with .htaccess](https://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – romal tandel Mar 09 '18 at 05:16

1 Answers1

0

The following code in your .htaccess file should take care of this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

or see this article

random_user_name
  • 25,694
  • 7
  • 76
  • 115
romal tandel
  • 481
  • 12
  • 19