Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Robots.txt

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
Mugil
Smarty n00b


Joined: 19 Apr 2012
Posts: 3

PostPosted: Thu Apr 19, 2012 11:27 am    Post subject: Robots.txt Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Apr 19, 2012 2:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Mugil
Smarty n00b


Joined: 19 Apr 2012
Posts: 3

PostPosted: Fri Apr 20, 2012 4:12 am    Post subject: Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Apr 20, 2012 7:01 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
johnn34
Smarty n00b


Joined: 18 May 2012
Posts: 1

PostPosted: Tue Sep 25, 2012 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP