Register Advertise with usHelp Desk Today's Posts Search

Thread Tools Search this Thread
Unread 9th Oct 2020, 12:14 AM   #1
Digital Marketing Expert
 
Thinkfast's Avatar
 
Join Date: 2008
Location: Jaipur, Rajasthan, India
Posts: 101
Thanks: 4
Thanked 25 Times in 23 Posts
Default
HTACCESS : Remove .php from but with slash (/) giving internal error
Share on: 
fb share twitter share gplus share more share

Hi,

Working on a client website for promotion and fixing also coding which cause errors on website.

We found an htaccess error and not getting that how to fix this issue. So need any htaccess expert guide to fix this issue.

https://www.amerrugs.com/about-amer (We can not define our issue without URL so we are adding this URL)

Original page of this URL /about-amer.php .... from htaccess we removed .php

But issue is when we are adding slash at last of this type of static page like /about-amer/ then its giving internal server error.

Htaccess code is as below

PHP Code:
Options +FollowSymlinks

RewriteEngine on

RewriteCond 
%{REQUEST_FILENAME} !-d

RewriteCond 
%{REQUEST_FILENAME}.php -f

RewriteCond 
%{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ $1.php 
I tried by add below code but still same issue.
PHP Code:
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)/$ $1.php 
Please let us know that how can fix this issue.

Save Upto 50% Digital Marketing (SEO, SMO etc.) Budget with Buy Credits Packages
Guest Posting Sites List - 10k+ Sites Collection, No PBN , Multiple Niche Markets .
Thinkfast is offline   Reply With Quote
Unread 11th Oct 2020, 04:46 PM   #2
New Warrior Member
 
littleguyhosting's Avatar
 
Join Date: 2020
Location: Hammonton, NJ
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Default
RE: HTACCESS : Remove .php from but with slash (/) giving internal error
Share on: 
fb share twitter share gplus share more share

I didn't test this but this should get you onto the right track.

RewriteRule !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$ ^(.*)/$ $1.php [L,NC]
littleguyhosting is offline   Reply With Quote
Unread 11th Oct 2020, 09:48 PM   #3
New Warrior Member
 
marksmith121's Avatar
 
Join Date: 2020
Location: 230 N Maple Avenue Suite B-1-616 Marlton, NJ 08053 United States.
Posts: 21
Thanks: 0
Thanked 7 Times in 7 Posts
Default
RE: HTACCESS : Remove .php from but with slash (/) giving internal error
Share on: 
fb share twitter share gplus share more share

Yes, you are on the right way you can do it but I checked your website is working fine but anyway.add this,
To enforce a trailing-slash policy:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R] # <- for test, for prod use [L,R=301]
marksmith121 is offline   Reply With Quote
Unread 12th Oct 2020, 07:40 AM   #4
New Warrior Member
 
Join Date: 2020
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default
RE: HTACCESS : Remove .php from but with slash (/) giving internal error
Share on: 
fb share twitter share gplus share more share

hey there, yeah I had the same problem and I got in touch with my hosting provider to revolve it, did you manage to resolve it also?
Eholic is offline   Reply With Quote
Unread 14th Oct 2020, 01:20 AM   #5
Digital Marketing Expert
 
Thinkfast's Avatar
 
Join Date: 2008
Location: Jaipur, Rajasthan, India
Posts: 101
Thanks: 4
Thanked 25 Times in 23 Posts
Default
Re: HTACCESS : Remove .php from but with slash (/) giving internal error
Share on: 
fb share twitter share gplus share more share

Originally Posted by littleguyhosting View Post

I didn't test this but this should get you onto the right track.

RewriteRule !^/.well-known/acme-challenge/[0-9a-zA-Z_-]+$ ^(.*)/$ $1.php [L,NC]
Tried this one ........ not working

Originally Posted by marksmith121 View Post

Yes, you are on the right way you can do it but I checked your website is working fine but anyway.add this,
To enforce a trailing-slash policy:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R] # <- for test, for prod use [L,R=301]
Tried this also but after this giving internal server errors for both URL ....... /about-amer and /about-mer/ both.

Originally Posted by Eholic View Post

hey there, yeah I had the same problem and I got in touch with my hosting provider to revolve it, did you manage to resolve it also?
Did not contact to hosting provider ........ will try with details now and see what is going on.

Still waiting for resolution.

Save Upto 50% Digital Marketing (SEO, SMO etc.) Budget with Buy Credits Packages
Guest Posting Sites List - 10k+ Sites Collection, No PBN , Multiple Niche Markets .
Thinkfast is offline   Reply With Quote


Bookmarks

Tags
error, giving, htaccess, internal, php, remove, slash


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 07:26 PM.