1
vote
0answers
44 views

Why can't I redirect url's with “index.html” in it to a php file?

I'm stuck in a big problem, but let me start with one part of it. I am wodering why this works: RewriteRule ^(.*)index.html $1 [R=301,L] while this doesn't: RewriteCond %{REQUEST_FILENAME} ...
1
vote
0answers
114 views

Apache SSL redirect loop

We are trying to redirect our site from http to https only. Everything we have tried in .htaccess has resulted in a redirect loop. If we manually type the "https://" in front of the url, our page ...
-1
votes
1answer
25 views

Overload Protection

Is there a simple way how I could redirect a visitor (via .htaccess or PHP script) to a static page when the server is overloaded from too many requests? It doesn't have to be a protection against ...
1
vote
1answer
18 views

.htaccess AuthType not what I expected

I'm working on a new project at work in PhP, and have come across something I'm unfamiliar with/can't find any help with. In the .htaccess file for the directory I see AuthType UWNetID require ...
-1
votes
1answer
25 views

Disable custom php.ini

I want to disable custom php.ini inside my shared hosting. I dont want to allow my clients to use it. I could block the usage of htaccess using allowverride but I cant see someway to block php.ini!
0
votes
0answers
122 views

Rewriterule not working on localhost, works fine on server

I'm trying to get rid of .php extension from my webpages. Here's my .htaccess file's code RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ...
0
votes
0answers
36 views

Custom rewrite rule - migationg to WordPress CMS

I am trying to move my image gallery site from one CMS to Wordpress. On current CMS I have page with medium size image on it with URL: ...
1
vote
0answers
68 views

Request exceeded the limit of 100 internal redirects due to probable configuration error

This error only seems to happen to a few pages. Others will load just fine, some slower, but others will error out: # BEGIN WPSuperCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...
1
vote
1answer
43 views

file-name is transparently redirecting to file-name.php

If I request /file-name I get /file-name.php's content back. I want to know how this is happening but can't seem to figure it out. I emptied the .htaccess and it's still doing it. I verified that the ...
4
votes
1answer
165 views

Htaccess application/type with PHP as FastCGI

Is there a way to use .htaccess with PHP as CGI/FastCGI? I would like to be able to have other extensions open as PHP. I have tried the following: AddType application/fcgid-script .phpd AddHandler ...
1
vote
1answer
3k views

Apache .htaccess <ifModule not allowed here

Running Apache on Ubuntu Precise, with PHP 5.5 Trying to access my var/www/ gives me a 500. /var/log/apache2/error.log shows: /var/www/web/.htaccess: <IfModule not allowed here my .htacess is ...
0
votes
2answers
3k views

Removing php extension with .htaccess does not work

I use the following code on my site elixnews.com to remove php extension from: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
-1
votes
1answer
76 views

off php engine and htaccess using regex in apache

I have some sites on a server. they all have a drectory named 'image-upload' where users of sites upload their images. I want to: Off PHP engine for this directory on all the sites disable ...
1
vote
0answers
59 views

Conflict with 3 different RewriteRules in .htaccess?

I'm using the below in my .htaccess file. There 3 types of redirects: redirect to directory /admin/index.php redirect to specific .php files e.g. /about redirect to user profile page from /John ...
0
votes
1answer
22 views

rewrite mod giving internal server error when trying to rewrite links

There is many questions discussing rewrite mod problems i have read them and none solved my unique problem, i already done 3 hour of research to solve it and still stuck. i want to rewrite links in a ...
0
votes
1answer
35 views

Understanding mod_rewrite syntax

When I write in .htaccess this mod_rewrite RewriteEngine on RewriteRule ^(.*)\.my_extension$ $1.php and open url: site.com/index.my_extension this wroks fine, opened index.php But when I am ...
4
votes
2answers
378 views

.htaccess redirect all extension to php

I recently updated my .htaccess file to hide the .php extension of the urls. It works nice, when I try to reach domain.com/index, it displays the php file. When I type domain.com/index.php it ...
2
votes
1answer
1k views

Unable to set php_value in .htaccess file

I am trying to set up NewRelic on my Apache2/PHP server, and have it report different applications per vhost. To do this, the php value newrelic.appname must be changed. It is defined by default in ...
0
votes
1answer
120 views

Apache ignoring .htaccess rules and returning 404 not found

I just set up Apache and PHP on a server running CentOS by using something along the lines of yum install httpd and yum install php. I've created the following file in /etc/httpd/conf.d/vhosts.conf: ...
-1
votes
1answer
432 views

.HTACCESS - remove part of the url

I am using in my cms with a pre-defined htaccess, as the following: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ...
0
votes
1answer
77 views

running .html as .php

How do I edit my .htaccess file using mod_fcgid to turn .html files to act as .php I tried: AddHandler fastcgi-script .html Did not work. I am using cpanel and using php 5.3 and apache 2.2.
1
vote
0answers
563 views

PHP.ini custom settings through htaccess

I'm confused by this ini list in the PHP Manual: http://www.php.net/manual/en/ini.list.php I want to set some custom php.ini values through htaccess, but which one of these commands is not going to ...
0
votes
2answers
85 views

How to block a user in apache httpd server from accessing a *.php file inside a Directory, instead user should access this using Directory name

My requirement looks Simple, But Googling Did not help me yet. my query is i want to Throw a 404 page to a user(Not Re-Direct to another folder or file), who is trying to Access *.php ...
1
vote
1answer
59 views

Apache Error 500 without log info when trying to access to a php5.3 website

I've the next problem. I had to do some rewriteUrl-work for a website... Well, in fact, I had to modify the already working urlRewriting. Being cautious, I saved a copy of the whole source code, even ...
3
votes
2answers
666 views

mod_rewrite remove trailing slash is causing loops

I have a site using mod_rewrite to make pretty URLs ... everywhere I read the removing the trailing slash is good for SEO and therefore I went with the rule: RewriteRule ^(.+)/$ /$1 [R=301,L] I ...
2
votes
2answers
117 views

How to serve different application & server based on cookie

I'm building the frontend marketing website for a web application. The frontend is WordPress on one server and the app is on another. We will set a cookie for users who are already customers. For ...
0
votes
1answer
42 views

.htaccess rewrite

I want to change URLs like below: http://www.gsmsite.nl/zakelijk/product/phone?b=met-internet-250plus To: http://www.gsmsite.nl/zakelijk/product/phone?bundel=met-internet-250plus How ...
1
vote
1answer
40 views

htaccess redirect from wordpress page to a php page

I have recently had to change a URL on a website (in PHP on Apache). The old URL is: http://content.mywebsite.org.uk/hidden/discounts/ When a user visits the above link. The new URL is: ...
0
votes
2answers
826 views

Overriding memory_limit with .htaccess resulting in mysterious alerts in syslog (suhosin)

PHP version: PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) Used in apache2 with: libapache2-mod-php5 The global options memory_limit for PHP is set to 512M. So far so good. Now a script tries to ...
1
vote
2answers
664 views

Apache is giving a 500 Internal server error on a sub domain created for my domain

I have created a subdomain by name http://admin.stenzsolutions.com and just to test the sub domain, i have hosted the same content as the main domain http://www.stenzsolutions.com Now i have ...
0
votes
1answer
195 views

wild card redirects issue giving error this webpage has a redirect loop

In my website I changed or better word modified the directory name ""vehicles-cars"" to ""vehicles-cars-for-sale"" when i tried to redirect using wild card redirect my old directory name to new ...
-2
votes
2answers
363 views

how to rewrite or redirect old or missing or invalid url to 404 page [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? I recently upgraded a site and almost all URLs have changed. I have redirected all of ...
0
votes
1answer
337 views

need help from some professional how to redirect old or invalid url

I recently upgraded a site and almost all URLs have changed. I have redirected all of them (or so I hope) but it may be possible that some of them have slipped by me. Is there a way to somehow catch ...
6
votes
9answers
968 views

Successfully, permanently ban a user from a website? [closed]

I have a social networking website and I want to ban a user from the website. I've added his IP address to the ban list in the .htacess file and to the php level for banning that user, but he keeps ...
0
votes
2answers
316 views

Change php's auto-append-file from a script

I am using the php config auto-append-file to append code that i need to be executed on all pages on a particular domain. But my problem is that there are other domains that share the same php.ini ...
-3
votes
1answer
119 views

Protecting a chmodded 0777 cache directory?

A website I'm developing requires several directories to have their permissions set to 0777. The directories are used as cache directories for HTML and PHP files generated by the website. The ...
2
votes
1answer
178 views

.php files see Apache environment variables, .html files don't

Consider this environment: $ cat .htaccess AddType application/x-httpd-php .php .html SetEnv Foo Bar $ cat test.php <?php echo "Hello: "; echo $_SERVER['Foo']; echo $_ENV['Foo']; echo ...
1
vote
1answer
419 views

Parsing .html as PHP: how to check which method would be right?

The usual way of parsing .html files as PHP is to add either the first (PHP as an Apache module) or both (PHP as CGI) of the following lines to an .htaccess file: AddType application/x-httpd-php ...
5
votes
3answers
328 views

Is my webserver allowing pre-fetching?

I have an image based website that hosts multiple galleries. When a user clicks one of the images the views property for the particular image is incremented. However, I noticed when using Firefox ...
8
votes
1answer
18k views

What is the name and location of the Nginx config file (htaccess equivalent)?

There are many tutorials on how to write Nginx rewrite rules to mimic Apache's .htaccess file but I can't confidently say I know what the name or location of this so-called Nginx config file actually ...
1
vote
1answer
117 views

Compress HTML using Apache

I'm using Apache to compress render HTML files but it's not working. Why? I'm usng hostmonster servers and YII PHP framework. .htaccess: <IfModule deflate_module> AddOutputFilterByType DEFLATE ...
0
votes
1answer
69 views

I am using mod_rewrite and am using a rewrite rule, is there a way for me to get the URL as seen in the address bar server side?

I can reconstruct the actual URL post rewrite rule, but is there a way for me to get the URL pre rewrite rule? Also, when I run php in IIS 7.5, and have rewrite rules in my web.config, how do I get ...
1
vote
1answer
129 views

Apache Hide Specific File Types from Web

I have a repository of files with .php, .sh, and .txt extensions which gets checked out to the web directory of my server (/var/www). I need the .php files to be able to be reached by typing in a url ...
1
vote
3answers
472 views

How do I get my htaccess file to read a php file?

I have created a PHP file which should detect if mobile or tablet. I gleaned the following code from a web search as I don't know any coding although years ago COBOL was my breadwinner! The code in ...
1
vote
1answer
142 views

Limit POST requests for a certain page

How can I disallow POST requests on a certain page of the website? Like disallow POST on http://site.com but allow it on subpages, like http://site.com/whatever or http://site.com/post.php The ...
-4
votes
3answers
312 views

.htaccess and PHP redirect hack on GoDaddy Website [duplicate]

Possible Duplicate: My server's been hacked EMERGENCY A friend is experiencing a random redirect to an RU domain for two of her websites, along with a malicious cookie attack, as per a ...
2
votes
1answer
81 views

Consistent way to map .HTML as .PHP

We started including some PHP into our web pages, but we wanted to keep our incoming links working. Instead of a bunch of redirects, we simply mapped HTML files to PHP via: AddType ...
1
vote
2answers
5k views

.htaccess Rewrite Rules Not Working (CodeIgniter)

Here's what I want to do: I'm using CodeIgniter, so all URLs are in the form of http://example.com/index.php/controller/function. However, the script I've written is a essentially a glorified link ...
-3
votes
1answer
190 views

Magento Using https:// for all links in source

So today I was trying to install a fresh instance of Magento v1.7.0 on my vps which is running nginx. Once I uploaded the clean install to public_html I unzipped it and entered my ip to run the ...
0
votes
1answer
752 views

Setting per-folder values for suhosin settings in .htaccess

I've set suhosin.perdir = 'p' in my ini file. I would now like to change suhosin ini settings on a per-folder basis. The following all work (running phpinfo() inside the desired folder shows the ...