-
Notifications
You must be signed in to change notification settings - Fork 9.4k
A few issues when you use /pub as DocumentRoot #1146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@buskamuza is it being addressed? |
+1 this issue needs attention. We should be able to use pub/ to serve from production. To clarify what I found: sitemap.xml: By setting up my sitemap.xml to generate into the pub/ directory I was able to place a file in the sub-directory fine and the resulting XML doesn't have any issues with pub/ in paths the file. robots.txt: I see two issues here: Magento will always write to the root folder and there is no way that I can see to change this via configuration. And additionally, if you have set the path of your sitemap.xml to pub/ as above then the robots.txt file created in the root has pub/ in it's "Sitemap: *" path. |
I just tested this with Magento 2.0.0 GA, and the issues still remain. robots.txt Steps to reproduce:
Problem: the robots.txt file is created in the Magento root directory, not in the Possible solution for serving Magento from both the sitemap.xml Steps to reproduce:
Problem: sitemap.xml is created in the Magento Continuing: Problem: sitemap.xml is created in the In this case a solution with a redirect/rewrite in the .htaccess/nginx config file isn't really possible as the path and filename of the sitemap are dynamic. Would be great if Magento (or somebody else) can come up with a way to solve this :) Thanks! |
Hi @tanya-soroka and @piotrekkaminski Do you guys have any updates for this ticket? Thanks, |
Do you have any update about this bug? Thanks, |
Luckily you can symlink your way around it, but yep, it's an issue. |
Hi @Marko-M Imagine every time marketing department will be asking developer to symlink generated sitemap.xml files :) |
Yep, an issue. |
Do you have any update for this issue? |
Still broken in 2.1.0 |
I too hoped this would be resolved in 2.1... we need a robots.txt file accessible on the frontend urgently and don't want to mess around with the hacks suggested above. |
@piotrekkaminski: maybe you should change the label from improvement to bug. I assume it will get picked up earlier if this is tagged as a bug, which it clearly is :) |
I expanded scope of MAGETWO-47607 to include also robots issue. |
Any update on this issue? cc: @pboisvert |
@mcspronko still in the queue to be fixed. |
@piotrekkaminski it seems like it is not critical to have proper sitemap.xml and robots.txt files for marketing purposes. Let me fix this issue :), might be faster. So reported 2400 websites will benefit from having proper indexation by search engines. |
@mcspronko researching why it wasn't included in latest patch. I understand the importance of this issue. |
Any luck with findings? |
I was able to workaround this problem by adding symlinks in pub to ../robots.txt and ../sitemap.xml respectively. Seems to work fine. |
still broken in 2.1.1 |
Hi @limajasachin, here is your Magento instance. |
This issue is not reproducible. |
I am working on this at #dmcdindia19 |
It can still be reproduced on 2.2.6. |
@magento give me 2.3-develop instance |
Hi @NetStorm84. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @NetStorm84, here is your Magento instance. |
This is still an issue in 2.3.1 |
Hi @progreg. Thank you for working on this issue.
|
Hey, @antonkril is this issue will ever be fixed? |
@mcspronko , an issue still reproducible and I have an idea how it can be fixed. |
Hi @mcspronko @progreg, |
Hi @ihor-sviziev, sorry to interfere but don't you think it would be good idea to at least add new configuration to installation process that would automatically set this line for new instances? |
@ihor-sviziev, Yeap you are right, it will fix the problem. Missed up your comment, thanks for the notice, seems this issue no longer need and it can be closed. |
@Bartlomiejsz We can open a new issue for this needs as this one have many unneeded details and also touches on Robots module issue that is no longer relevant. |
Preconditions (*)
Steps to reproduce:
robots.txt
Update: The robots.txt part is no longer valid, was fixed in Magento 2.2.0
sitemap.xml
Steps to reproduce:
pub
directoryActual result (*)
Problem: sitemap.xml is created in the Magento
root
directory and in the column 'Link for Google' it says:http://example.com/sitemap.xml
, which is incorrectContinuing:
6. Click on the sitemap entry in the table
7. Change the Path to '/pub/'
8. Click 'Save & generate'
Problem: sitemap.xml is created in the
pub
directory, but the column 'Link for Google' now says:http://example.com/pub/sitemap.xml
, which is also incorrectIn this case a solution with a redirect/rewrite in the .htaccess/nginx config file isn't really possible as the path and filename of the sitemap are dynamic.
Would be great if Magento (or somebody else) can come up with a way to solve this :)
Thanks!
Expected result (*)
The text was updated successfully, but these errors were encountered: