![]() |
RewriteRule not working...
Hi,
Here is what i have so far. Friendly URL: http://site.com/YML/profile/myquickname Original URL: http://site.com/YML/profile.php?id=myquickname .htaccess: Code:
RewriteEngine OnThanks |
There shouldn't be a forward slash at the beginning of the path (
/YML/profile.php...) unless you're providing an absolute path (like /home/username/public_html...). |
thanks for your help, i changed it to the following but its still not doing anything. when i go to the friendly url i just see a 404 error page.
Code:
RewriteEngine On |
Are you typing in the right case?
Might be best to add the NC flag ([L,NC]) Is the original url working correctly without mod_rewrite? Hard to diagnose without a working url. |
"Are you typing in the right case?" - Do you mean the YML in capitals? if so yes, thats exactly as it is structured.
The original link ( http://site.com/YML/profile.php?id=myquickname ) is working fine on the site but the mod rewrite still isnt doing anything. Here is what it looks like now: Code:
RewriteEngine On |
Are you sure your web server has "AllowOverride ALL" configured??
|
Would i have to contact my hosting company to find that out?
|
Try putting the following in your .htaccess
Code:
Options +followSymlinks |
i tried adding that line before and then after the rewrite, they didnt make any change...
|
i just found this in my hosting CP:
Code:
<DIRECTORY /hsphere/local/home/mysite/site.com> |
yes, it's fine then
It must be some syntax problem, I don't really understand the rewrite syntax, so can't help, sorry |
Are you sure the rewrite module is loaded in the apache config too? You can check the httpd.conf (search for rewrite), or run phpinfo() and search for mod_rewrite in apache2handler to find out.
I can get this to work on mine, Code:
RewriteEngine On-m |
mod_rewrite appears under Apache but i still cant get it to work! :S
thanks for everyones help so far, im going to contact the hosting company to see if its something on their side. |
Try
Code:
RewriteEngine On |
try php.net/dl
|
Sunnuvabitch. I've been working for so long on my test server, that I didn't realize something very important about my stupid host. A lot of functionality for my web site depends on mod_rewrite. I was going to upload what I have done so far, in order to post it here and have everybody try and break it, to see if anybody could find any bugs, and guess what?? My damned production server doesn't have mod_rewrite!
So I call them to ask them if they can turn it on, and I get some dumb ass working tech support who doesn't know a thing about tech support telling me that they can't turn it on because it could cause problems with other people on the server. After explaining to him three times that it can't possibly hurt anybody, as turning it on doesn't disable any functionality, it only adds functionality, and there's no inherent security risks involve, AND that it's part of apache already, the whole thing would take about four seconds of effort, he promised to "prioritize" my request to the engineering department. That was also after I asked him to talk to somebody who could actually help me, four or five times. NetworkSolutions is crap. For a company that's been around a long time on the web, you'd think they would have something to offer, but noooo, if anything they've turned into an unethical pile of dog turd. (I mention unethical due to their practice of front running domains, and I'm sure other shizzle too). Anywho, just had to bitch, I'm going to go and start shopping for a decent host now. Any suggestions? I don't need a dedicated server yet, I just want a simple, affordable host with PHP 5, MySQL 5, and mod_rewrite. :-) -m |
toastedpenguin.com - Home - I haven't used them (yet) but I can tell their customer support is good from talking with them (over e-mail).
|
perhaps you can try this... I hope this can help you.
Agus Pang (http://aguspc1.blogspot.com/) Jakarta, Indonesia. open file xampp/apache/conf/httpd.conf find AllowOverride None change into AllowOverride All find #LoadModule rewrite_module modules/mod_rewrite.so change into LoadModule rewrite_module modules/mod_rewrite.so or http://blog.taragana.com/index.php/a...-working-in-ht... I faced a hair-tearing problem. mod_rewrite was loaded and yet it was not working in .htaccess files (and httpd.conf initially). Here is the solution along with how you can debug mod_rewrite problems. Debugging procedure: Add these two line to your httpd.conf immediately after RewriteEngine On. RewriteLog "/var/log/httpd/rewrite_log" RewriteLogLevel 9 After that I added the required RewriteRule etc. The reason for testing directly in httpd.conf is to ensure that mod_rewrite is working in the first place. After some debugging I realized my expression was wrong. So now I found mod_rewrite was working in httpd.conf. However it still wasn't working in .htaccess files. Solution: I found AllowOverride was set to None in httpd.conf. I changed it to All (after all I am the only user of the machine). And it finally started working everywhere (after a restart). What I learnt: Unmanaged dedicated web hosting is really really painful, unless you are (or have) a good linux system administrator. Too many things to setup and too many points of failure. And I haven't even started working on serious hardening stuff. |
Holy thread revival batman.
Oh and if anybody is wondering, Linode.com, best VPS host hands down. |
Help requested
I have a problem same as reported here
I updated the httpd.conf file to set AllowOverride ALL and then i get the internal 500 server error. My mod_rewrite module is loaded. But none of the rewrite rules work. all result in an error. Can one of your experts please advise? thanks Sonali |
| All times are GMT. The time now is 04:21 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0