Tag Archives: .htaccess

edit .htaccess to load php extension?

Questions: I follow this post to enable PHP5 XSL extension on apache server: .htaccess instead of php.ini php_extension xsl.so After added the line above, it show the 500 internal server error. and recommend? Answers: Apache accepts PHP settings inside .htaccess files only if PHP is installed as a module and thus loaded as part of… Read More »

PHP method=“post” stopped working after I added this .htaccess… Why?

Questions: I’ve added this .htaccess to remove file extension from the URL, so instead “index.php”, it would show “index” only, all the times. But after I did it, my <form method=”post”> stopped working Options +FollowSymLinks -MultiViews Options +Indexes AcceptPathInfo Off RewriteEngine on RewriteBase / #Force from http to https RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} !^mysite.com$… Read More »

CodeIgniter multi-application .htaccess problem

Questions: I have a problem with CodeIgniter .htaccess file and hope that somebody can help me! I don’t know regular expressions or how to use the .htaccess, I’m very new with this things! My Problem is: I have this structure of files (multi application): – application – admin – site – system – index.php -… Read More »

How to create clean url using .htaccess

Questions: This is my .htaaccess code. RewriteEngine On RewriteRule ^([a-zA-Z0-9]+)/$ movie.php?name=$1 RewriteEngine on RewriteCond %{HTTP_HOST} ^www.example\.in$ RewriteRule ^/?$ “http\:\/\/example\.in” [R=301,L] ErrorDocument 404 /404.php AddDefaultCharset UTF-8 Header unset ETag FileETag None I need clean url for my website. I’ve referred lots of tutorials and forums and created the above code. But not working.. Almost I’m fighting… Read More »

How can I disable mod_security in .htaccess file?

Questions: How can we disable mod_security by using .htaccess file on Apache server? I am using WordPress on my personal domain and posting a post which content has some code block and as per my hosting provider said mod_security gives an error and my IP has gone into firewall because of mod_security. So I want… Read More »

.htaccess rewrite: subdomain as GET var and path as GET var

Questions: Desired result: http://example.com/ -> index.php http://www.example.com/ -> index.php http://hello.example.com/ -> index.php?subdomain=hello http://whatever.example.com/ -> index.php?subdomain=whatever http://example.com/world -> index.php?path=world http://example.com/world/test -> index.php?path=world/test http://hello.example.com/world/test -> index.php?subdomain=hello&path=world/test With the .htaccess I have right now, I can achieve one or the other re-mapping, but not both at the same time. RewriteEngine On # Parse the subdomain as a variable… Read More »

.htaccess deny access to specific files? more than one

Questions: I am able to disable access to a file with .htaccess, but I don’t know how to disallow multiple files to be viewed (directly, not from includes) They are .php so I can’t disable a file type (like the only tutorials online say..) <FILES … ? </FILES> Or something.. For example “home.php, file.php ,… Read More »

Error with .htaccess and mod_rewrite

Questions: I’m trying to host a php based application with the following .htaccess values. Options +FollowSymLinks Options -Indexes DirectoryIndex index.php RewriteEngine On RewriteBase /easydeposit RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] However, I keep facing the following two errors, [access_compat:error] [pid 25330:tid 27] AH01797: client denied by server configuration: /home/abc/opt/apache/htdocs/xyz/system/ [access_compat:error] [pid… Read More »