0

i have host my website in godaddy webserver and i try to use htaccess file but it didin't work please tell me what the solution and help me to make it work

    Options +FollowSymLinks -MultiViews 
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

## hide .php extension
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]

## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]
helpdoc
  • 1,910
  • 14
  • 36

1 Answers1

0
  • Use FileZilla or any other software navigate to the root of the website you want to apply these changes.
  • Find .htaccess file (Use any editor to edit the file)
  • Change it with the following code.

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^YOURSITE\.com\\index$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.YOURSITE\.com\\index$
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^/?$ "http\:\/\/www\.YOURSITE\.com\/" [R=301,L]
    
    # Turn mod_rewrite on
    Options +FollowSymLinks -MultiViews
    
    RewriteBase /
    
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php [QSA,L]
    
    # Redirect /product?pid=2 to /product/2
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+product\?pid=([^&\s]+) [NC]
    RewriteRule ^ /product/%1? [R=302,L]
    
Ussaid Iqbal
  • 786
  • 1
  • 7
  • 16