Problem
Twiebie |
|
---|---|
I've got a big problem..
I've tried to do some modifications on the url's, and I think I messed it up pretty good.. None of the url's in the account menu are working, the admin panel is not working as it should and a lot of other links do not work anymore and are all changed to www.mydomain.net instead of for example www.mydomain.com/admin.php Is there any way I can reset this? ![]() Edit: Pfew, replacing urltrans.dat with the original one from the Cotonti package got it back to normal. I did read http://www.cotonti.com/docs/en/admin/url_modification, but I still can't really figure out how to set it up properly, can someone give me some assistence with this? |
|
This post was edited by Twiebie (2010-10-02 01:38, 14 years ago) |
peptobismal |
|
---|---|
Okay, well, I had this problem? I know how to revert it back, but not to get it to modify URLs. Already have confirmed my server to have mod_rewrite on it as well.
Under the heading: Basic URL Tool Details It gives this: http://xxx.xxx.xxx/admin.php?m=urls < As a way to go straight to the URL Modification, just reset it all back, instead of doing things the hard way. Other than that I am no help. I've been messing with values here and there to see which ones work for the pages without displaying different errors. |
GHengeveld |
|
---|---|
Personally I always write the urltrans.dat myself instead of using the admin panel. That has always given me much better results, probably because I've never really understood the admin interface for this.
It is actually very simple. You just have to make sure that your .htaccess rules match up with the urltrans rules. The most generic rules (* * {$_area}.php being the absolute most generic) should always be at the bottom. For example: admin m=* admin/{$m} admin * admin pm * pm users * members index * home rss * rss * * {$_area}.php The first item (column) on the line is the name of the file (script) you're writing the rule for, so forums.php becomes forums. The second item is the query string you want to match, but leaving off the questionmark at the beginning. A variable in your .htaccess is an asterisk (*) in urltrans.dat. The third item is what the url will come to look like after the transformation. This is what the .htaccess rewriterule should match. You can call a query string parameter from the second item by preceding it with a dollar sign ($) and enclosing it with accolades. See the first line in the example above: m=* becomes {$m} Here's a more complicated rule (first the urltrans.dat line, then the .htaccess rule): plug e=userresults&u=*&resid=*&m=scores {$u}/scores/{$resid} RewriteRule ^(.*)/scores/([0-9]+)$ plug.php?e=userresults&u=$1&resid=$2&m=scores [NC,NE,QSA,L] I hope this helps. Don't forget that items/columns must be separated by one tab. |
|
This post was edited by Koradhil (2010-10-05 04:32, 14 years ago) |
Twiebie |
|
---|---|
Thank you for giving some more detailed information, but i'm still not completely sure on how to do it. My knowledge about stuff like this is still very basic.
If for example I would like to rewrite this url: /plug.php?e=contactus into /contact What should be placed in urltrans.dat and what should be placed in .htaccess? I'm trying to fully understand it before I might screw it up again.. |
GHengeveld |
|
---|---|
In urltrans.dat:
plug e=contactus contact In .htaccess: RewriteRule ^contact$ plug.php?e=contactus [NC,NE,QSA,L] You see, the rightmost column in urltrans.dat is what you put first in the rewriterule. The first two columns are combined and form the second part of your rewriterule. One more note (not related to the above): If you want to match a parameter in urltrans by using a * (for example e=someplug&var=*) but you don't want the value for 'var' to be in the output url, you have to put {!$var} instead of {$var}. |
urlkiller |
|
---|---|
One more note (not related to the above): interesting! URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
|
Twiebie |
|
---|---|
Ok, i've got it working for all the basic url's such as forums, plugins, contact etc..
I still have another question though. Take for example this url on the Cotonti website: www.cotonti.com/downloads/releases/genoa_0610 Normally that would be like this: www.cotonti.com/page.php?id=23 How does that work? |
urlkiller |
|
---|---|
if you have really read the article you would know that it uses the functions.custom.php in system folder to add functions for the rewrite process...
so basicly the htaccess file delivers a "rewritten" url for cot to understand and know how to work with. in your example to: page.php?id=123 . URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
|
GHengeveld |
|
---|---|
Yes, what you want is advanced rewriting. There's some examples in the article that you can use for that (the one for pages).
|