Answer the question
In order to leave comments, you need to log in
Hello, can you please tell me how to implement the entry to the component page right away?
Good evening. Maybe not a very right question, but the fact is that I do not know how to ask it more precisely. I'll show you an example.
There are routes:
export default (
<div>
<Route exact path='/' component={Home} />
<Route path='/auth' component={Auth} />
<Route path='/photo/:id' component={DetailPhoto} />
</div>
);
ReactDOM.render(
<Router>
{routes}
</Router>,
document.querySelector('#app')
);
Answer the question
In order to leave comments, you need to log in
It is optimal to store not absolute links in the database, but relative paths.
And so there are many options, at least the notorious replay for the sample.
on the site-msc.ru site you write redirects and that's it,
although of course you need to run the database regularly and delete this file
Maybe not everyone understood me, but I found the answer.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question