URL rewriting errors in my htaccess file - .htaccess

everyone..
I need to rewrite this URL
http://www.mydomain.com/profiles/tutors/index.php?tutorCode=1255&tutorName=Kasun%20Perera&city=Bandarawela
like this
http://www.mydomain.com/profiles/tutors/1255/Kasun+Perera.html
I tried this with Apache’s mod_rewrite feature. But I couldn't reach to my expecting result.
Here is Code that I have tried.
RewriteEngine on
For specific teacher:
RewriteRule ^lanka_institute/profiles/tutors/([0-9]+)/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/$ index.php?tutorCode=$1&tutorName=$2&city=$3
It is not working and then I can get this error message.
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, admin#localhost 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.
any comments are greatly appreciated.
Thank you.

Related

Showing error on live server i.e Forbidden

My website is running fine on localhost but on live server it is showing an error i.e.
Forbidden
You don't have permission to access /package-booking.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
This error is showing after following 3-4 next pages from index.php page. I have also changes the public_html's all directory permission to 0755 and files to 0644 but still facing the same problem. Please help me out, I am poorly stuck in it. Thanks in advance.

I want to hide any request on the following php file to www.prismile.com/

i have done like
<IfModule>
RewriteEngine On
RewriteRule ^/index.php$ http://www.prismile.com/ [R,NC,L]
RewriteRule ^/corporate_philosophy.php$ http://www.prismile.com/ [R,NC,L]
RewriteRule ^/search.php$ http://www.prismile.com/ [R,NC,L]
</IfModule>
but it showing me message like
Internal Server 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.
please help me to get it resolved. Thanks

WAMP 500 Internal Server Error .htaccess

I know there are lots of topics there about this error, but i hope you can help.
here's the error message:
The server encountered an internal error or misconfiguration and was
unable to complete your request. Please contact the server
administrator at admin#example.com to inform them of the time this
error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error
log. Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80
I think the problem is caused by .htaccess file:
DirectoryIndex index.php index.php3 messagebrd.pl index.html index.htm# disable directory browsing
Options ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch -Indexes**
Server 500 errors can be quite a hassle to diagnose, but if you think its the .htaccess file that is causing the problem you need to work out which line is the problem by a simple process of elimination.
Start by removing the .htaccess file, and start apache
Then add one line at a time to the htaccess file restarting apache after each change.
When apache fails to start then you know what line in .htaccess it is that is causing the problem

404 Redirect Error with .htaccess

I'm running a website on a local server (using WAMP Server) and I'm trying to test to see if my 404 page would work, but when I try to navigate to a nonexistent page, I get an error that says:
The requested URL /dsf/sdkmf was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.
My 404 page is in the root folder with all my other pages and my .htaccess Error Document handle is listed as:
ErrorDocument 404 /404.html
I don't know why it's throwing me this error much less how to fix it, does it have something to do with my WAMPServer configuration?
Never mind - I figured out how to solve it on my own - apparently you have to use the direct path to the file - even if it's in the root directory of the site itself!

my .htaccess is giving me a Forbidden error

I have the following in the root directory of my site:
RewriteEngine on
RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1 [QSA,L]
The .htaccess should be redirecting any request 3 chars or longer without . in the string to the index.php/$string-text as to query my CMS db for output, however when i try and load the index page I get a 403 forbidden error... My .htaccess knowledge is quite basic so try and be easy with me! :)
Thanks
Ric
There does not appear to be anything unexpected with your .htaccess file. If the mod rewrite was not configured correctly, I would expect to see 404 errors or the user being redirected incorrectly. As this does not appear to be the case; you need to widen your search to check that there are no security settings out of place.
I cannot see anything obvious in the httpd.conf file, but here are some of the steps you might want to take.
Remove the .htaccess file - if the website loads okay - then this file is causing an issue somehow; if it doesn't then there is something else wrong.
Check permissions on the web directory being used; there may be a permissions problem.
Check the httpd error log for suggestions.
Ask the question over at serverfault.com or poweruser stack exchange sites.
Ok! So I found the issue, The apache error_log file explained I needed to add this into my .htaccess file and the httpd.conf file -> "Options +FollowSymLinks +SymLinksIfOwnerMatch" and it worked! Now to create my VHost and I am good to go!!! Thanks!!!!!
Thanks
Ric

Resources