1

Here is my .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>

Apache server httd.conf file modifications

<Directory "${SRVROOT}/htdocs"> 
    Options -Indexes
    Options Indexes FollowSymLinks
    Require all granted
</Directory>
<VirtualHost localhost:80>
  DocumentRoot "C:/Apache24/htdocs"
  ServerName localhost
  Redirect /localhost /
  Alias /localhost "C:/Apache24/htdocs"
</VirtualHost>

I'm using react app When search localhost it shows the page but when i search localhost/contact directly on browser it doesn't work it return 404 not found

what I did wrong? I want to show the page that's inside the React app when I directly search it in the browser

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.