Hi!
I will have write some engine sending e-mails so I have to write some .htaccess file. I want rewrite this address: test.local/index.php?c=$controller&m=$method to something like it: test.local/controller/method/
I have loaded mod_rewrite module. Please help me!
3 replies to this topic
#1
Posted 17 January 2011 - 02:03 PM
|
|
|
#2
Posted 18 January 2011 - 05:03 AM
I believe something like this is what you want:
You can of course limit it to words, digits or whitespace with \w, \d or \s instead of the whole segment ([^/]*)
RewriteEngine on RewriteCond $1 != index.php[FONT=Tahoma] [/FONT]RewriteRule ^([^/]*)/([^/]*)$
You can of course limit it to words, digits or whitespace with \w, \d or \s instead of the whole segment ([^/]*)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 18 January 2011 - 09:56 AM
It isn`t working. When I access http://test.local/adrian/wiercioch/ to browser, prints me error:
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.14 (Ubuntu) Server at test.local Port 80
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.14 (Ubuntu) Server at test.local Port 80
#4
Posted 18 January 2011 - 07:04 PM
Oh I apologize, I forgot to write what it should be rewritten to. Try this:
Ensure you check Apache's error logs in case there is an error, it should tell you.
RewriteEngine on RewriteCond $1 !=index.php RewriteRule ^([^/]*)/([^/]*)$ /index.php?c=$1&m=$2 [L,QSA]
Ensure you check Apache's error logs in case there is an error, it should tell you.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









