2 users online. Create an account or sign in to join them.Users
Change the CMS url or path from /symphony/ to /cms/
This is an open discussion with 10 replies, filed under General.
Search
I would have thought that if you change the rewrite to broadly redirect all /cms to /symphony, but leave the folder name itself alone (so any filesystem access still works) you should get the result you want.
Rewrite rules are a bit of a dark art so it might take some experimentation but it shouldn’t be too tricky.
I have tried this a few weeks ago, and I couldn’t get it to work in less than 5 minutes.
What I’ve done: change the symphony rewrite rules to cms rewrite rules. Then, before that line, I’ve added a redirect from symphony to cms (to make all the urls in the backend work).
Again, I could not get it to work in less than 5 minutes, so I gave up. It should be possible though.
I’ve been playing with this for subdomain purposes, and /admin purposes, but I can never seem to get it to work. Even when I’ve got all the htaccess rule logic right, it never works as expected. I can get it to find the login page at my new url, but as soon as I log in it always tries to append /symphony back to the url, which balks.
In my opinion, having rewrite rules to /symphony as a dynamic url while also having a physical /symphony folder is not a good way of doing things, as it seriously confuses mod_rewrite if one tries to change things as we are doing. IMHO the /symphony folder should be called something like /symphony-core to save confusion. That way more customisation work could be done on rewrites.
Also, I think that some urls via /symphony (ie /symphony/blueprints/blah/blah etc) are hardcoded in the backend which makes this task very difficult as @creativedutchmen has said above. Resolving this would require the user to specify in the install what they want the ‘admin’ area url to be, and have this as a changeable option in config.php, so that a dev could change it for the filesystem access to ffind, and also let them update the htaccess to reflect the change.
I would really love this to be a big discussion ammong the community, and core team. There is so much more power in mod_rewrite than currently used in Symphony (because you have to sell your body to satan to know it!).
@designermonkey & @creativedutchmen,
Thanks for your advice,
I think I’ll let it be for now. I would definitely like to see the ability to customise the cms/admin path as, even though it’s a minor superficial issue, I imagine it’s something that a lot of clients would question and could be interpreted as lazy development to leave in signs of development process
IMHO the /symphony folder should be called something like /symphony-core to save confusion.
Or just /core or /code; let’s stay away from long directory names. This confusion over Symphony having a symphony sub-directory caused a problem in a thread earlier this week. I vote that it be changed.
The ability to define the location of the administration URL is planned for Symphony 3 and you can see how it works by trying out Symphony 3 beta: http://github.com/symphonycms/symphony-3
Under /manifest/conf/core.xml look for the element:
<administration-path>symphony/</administration-path>
Thanks for that heads up Allen, I’ve not used Symphony3 yet but will definately look now…
I should have known you’d have thought about this ;)
Hi, I’ve found a way to change the /symphony url (it works for me with 2.1.1). You just need to follow a few steps.
You’ll need a text editor with the ability to find and replace over an entire project. I use TextMate, which has the function under ‘Edit > Find > Find in project…’
These are the steps to follow:
- Do a global find and replace in the root directory of your symphony project
- Find /symphony/ and replace all with /cms/
- Then find /symphony and replace all with /cms
- Then find /symphony’ and replace all with /cms’
- Then find ^symphony and replace all with ^cms
- Finally, rename the ‘symphony’ directory to ‘cms’
NB: you could obviously use any other address such as ‘admin’ for the url, I have just used ‘cms’ as an example
… So that seems to work for me at the moment, although I’m not sure if this is the greatest idea - Extra extensions may also hard-code the backend url, so perhaps you would have to follow the above Find/Replace steps every time you added an extension?
I’m only a beginner so I can’t be sure, but maybe it’s best to wait for version 3!
@tylerdudley1986. Thank you very much for instructions.
The above steps almost work. This is with some improvements:
Path 1
If you have a regex enabled search, then do a global search in *.php, *.js, *.htaccess files for
(?<!(http:).{0,100})(\/|\^\(?)symphony(?!(\.|cms|-|21|;))
and replace with
$2cms
Then skip to step _6.
Path 2
If you don't have regex support, do the following:
_1. Find /symphony/ and replace all with /cms/
_2. Find /symphony' and replace all with /cms'
_3 Find /symphony and before replacing all with /cms, make sure you eliminate the following matches because there maybe some paths like /extensions/ckeditor/assets/symphony.ckeditor.js referring file names, which you don't want to change...
_4. Find ^symphony and replace all with ^cms
_5. Find ^(symphony/ and replace all with ^(cms/
_6. Open /symphony/assets/admin.js. Search for this line (depending on the Symphony version. In 2.2.5 it's at line 467). You have a + 9 value at the end of the line. It corresponds to strlen("Symphony") + 1. For cms you will have strlen("cms")+1=4 => + 4.
_7. Finally, rename the symphony directory to cms
Please review and test and if you find other modifications required, post in this thread and I'll update this comment.
Whoa there, you should never have to rename the symphony directory. It has programatic access only.
What you're trying to achieve here is to change the pseudo /symphony url for users, not where the core sits.
This is why it's never a good idea to do this. Extensions will rely on the core DIR being called symphony and you will break them
edit:
Also, I think this may have been addressed in the future 2.3 release, but will have to ask Brendan to clarify this...
Create an account or sign in to comment.
Is there any simple way to change the url to the cms from http://sitename.com/symphony/ to http://sitename.com/cms/?
I tried renaming the directory and changing the admin rewrite rules referring to the the symphony directory to cms in .htaccess but I got these errors:
From a quick look at the source seems that the /symphony/ directory is hard coded and I don’t know how deep the references go so I don’t want to go digging.
Is there any simple solution?
Thanks