Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-03-06 09:02:50

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

[Solved] How do I change http://example.com/textpattern to /admin?

Hello,
I just need a small change to be done, all I want is to access admin panel by typing /admin in URL instead of textpatttern. This is just for added security & hiding the backend system from unwanted attention.

Right now I achieve this by creating a dedicated page with front authentication, it works pretty well most times but it’s not that useful when clean URLs are not supported by the server.

I’d really like to know how you guys tackle this issue.

Thanks for your time.

Last edited by vineonardo (2013-03-06 09:41:37)

Offline

#2 2013-03-06 09:22:03

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [Solved] How do I change http://example.com/textpattern to /admin?

You could use symbolic links:

$ cd /path/to/dir/where/textpattern/dir/is
$ ln -s textpattern admin

The above commands will create a relative symbolic link from ‘admin’ to ‘textpattern’.

After which you can additionally redirect requests from /textpattern to /admin with some redirect rule of your choice. Textpattern will still create links that point to the old location, for instance password reset links. One way of redirecting the requests is by using a small Mod_Rewrite rule placed in the /textpattern directory:

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteCond %{REQUEST_FILENAME} /textpattern/
	RewriteRule ^(.*) /admin/$1 [R]
</ifModule>

Other options to moving admin location include using the multi-site setup or playing with rewrite modules among others. There are existing topics about this stuff around this forum.

Offline

#3 2013-03-06 09:41:22

vineonardo
Member
Registered: 2011-08-31
Posts: 128
Website

Re: [Solved] How do I change http://example.com/textpattern to /admin?

Hello Gocom,
Thanks for the answer, very helpful.

Offline

Board footer

Powered by FluxBB