|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Mugil Smarty n00b
Joined: 19 Apr 2012 Posts: 3
|
Posted: Thu Apr 19, 2012 11:27 am Post subject: Robots.txt |
|
|
I would like to add the robot.txt file in Smarty.
When i put it under public_html or contents in controller its not getting opened when i try to access the file in uploaded server.
Where should i put this robots.txt file?
Please reply
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Apr 19, 2012 2:34 pm Post subject: |
|
|
You would have to set an Apache directive to force the file to be treated as a PHP file. From there you would use a Smarty template to generate the output of robots.txt.
I'm not sure why you'd want this in a Smarty template? Just put a static robots.txt file in the document root. |
|
Back to top |
|
Mugil Smarty n00b
Joined: 19 Apr 2012 Posts: 3
|
Posted: Fri Apr 20, 2012 4:12 am Post subject: |
|
|
mohrt wrote: | You would have to set an Apache directive to force the file to be treated as a PHP file. From there you would use a Smarty template to generate the output of robots.txt.
I'm not sure why you'd want this in a Smarty template? Just put a static robots.txt file in the document root. |
I am doing that since SEO people asked me to do so.
I added robot.txt in my root directory but i could not access the file by typing the url http://domainname/robots.txt for eg if you put an file in root directory for an site www.samplesite.com you can access it by typing http://www.samplesite.com/robots.txt but i am unable to access this |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Apr 20, 2012 7:01 am Post subject: |
|
|
Mugil wrote: | mohrt wrote: | You would have to set an Apache directive to force the file to be treated as a PHP file. From there you would use a Smarty template to generate the output of robots.txt.
I'm not sure why you'd want this in a Smarty template? Just put a static robots.txt file in the document root. |
I am doing that since SEO people asked me to do so.
I added robot.txt in my root directory but i could not access the file by typing the url http://domainname/robots.txt for eg if you put an file in root directory for an site www.samplesite.com you can access it by typing http://www.samplesite.com/robots.txt but i am unable to access this |
thats not a smarty problem, check your file permissions. |
|
Back to top |
|
johnn34 Smarty n00b
Joined: 18 May 2012 Posts: 1
|
Posted: Tue Sep 25, 2012 9:33 am Post subject: |
|
|
You have to put it in the root folder of your website. Also if you are unable to access the robots.txt file even if it’s present in the root folder, you should check the URL configuration and rewrites. Many custom CMS rewrites all URLs to some standard forms. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|