0
votes
1answer
35 views

Multiple rule Apache rewrite and standard pages

In reference to: Multiple rule Apache rewrite While this works great for the multiple levels of item drill down I still have need for an admin.php page to run outside of the rule. Currently under ...
1
vote
1answer
174 views

Make mod_rewrite rules process before fcgi sees the request

Is there a way to have the mod_rewrite rules in my .htaccess file take effect before PHP behind fcgi sees the request? I have an email validation link that I want to redirect from root to the login ...
1
vote
3answers
171 views

Index.php downloads instead of opening

Ok, so I have a server at work that I am setting up sites on. It has a Wordpress site in the root, a phpBB forum in a child directory, and a support site in another directory. I'm able to access both ...
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
vote
1answer
119 views

Debugging htaccess rewrite rule; 2nd capture group ($2) empty

I've seen this issue crop up for other people, but in their cases, there was an issue with their regex. A quick trip to regexpal.com indicated to me that this was not the case. I have a simple ...
0
votes
0answers
38 views

Script working from test to production server

I am running the following script: http://phprestsql.sourceforge.net/ My test environment is a WAMP server running Apache 2.2.17 and PHP 5.3.4 My production server is running Apache 2.2.14 and PHP ...
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
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 ...
0
votes
1answer
241 views

apache simple rewrite rule or rewrite condition for query string

Im trying to add a rewrite rule to my htcaccess file and the part Im having trouble wth is the query string. I want to add the query string parameter pid to the rewrite rule. Both lines of code don't ...
2
votes
1answer
3k views

Cannot get mod_rewrite to work on Mac OSX Mountain Lion

I have tried everything I can think of and it still doesn't work. I am trying to get the example code from Larry Ullman's Advanced PHP book to work. His instructions were a bit lacking so I had to do ...
0
votes
2answers
82 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 ...
2
votes
1answer
109 views

Trouble with mod_rewrite and PHP Extensions - Help Making the Correct .htaccess File

I'm looking for a set of simple rules and redirects for my site. I've tried so many combinations that I'm starting to get confused. I'm not sure how to set this up. Generally, without mod-rewrite, ...
3
votes
2answers
638 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 ...
0
votes
2answers
226 views

.htaccess not being read in var/www but is in /var

I installed apache2.2, php5, and mysql all with apt-get install. I am using vmware for a Ubuntu 11.04 VM. I am having trouble getting .htaccess being read in the document root. Here is my apache.conf: ...
0
votes
1answer
68 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 ...
3
votes
2answers
624 views

Apache reports a 200 status for non-existent WordPress URLs

The WordPress .htaccess generally has the following rewrite rules: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
1
vote
2answers
31 views

Access directory while mod rewrite is on

I am using the following .htaccess file to keep my URL's clean RewriteEngine On RewriteRule ^([a-zA-Z\-0-9]+)/?$ index.php?get1=$1 [B] RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?$ ...
1
vote
1answer
84 views

Mod_rewrite issue in setting up on Snow Leopard [duplicate]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? I have come back to this as got sidelined on other things for ages. So please find my ...
1
vote
1answer
204 views

rewrite rule changed the base path of the web app

I have a simple web app and I set it up to use .htaccess for rewrite rules. Options +followSymlinks RewriteEngine on Rewriterule ^records/view/([0-9]+)$ ./record_view.php?id=$1 [NC] It works but ...
0
votes
1answer
37 views

Rewriting /latest produces server error

So I'm working on a site for a magazine, and I want the URL /latest to rewrite to the file latest.php. I'm working on a cPanel hosting server, so I put a .htaccess in the /public_html directory like ...
-1
votes
2answers
127 views

Apache Web Server with Multiple PHP Webapp Servers

What is the best scalable architecture for an Apache/PHP environment? I would like to use a single Apache instance and offload requests to N web application (PHP) servers; how is this typically ...
0
votes
1answer
96 views

How to set up a basic mod_rewrite?

I've heard that you can use mod_rewrite to clean up your URLs, and basically I'd like to make it so the .php file extension isn't shown in the URL. For example, let's say I have the following file ...
0
votes
1answer
120 views

How to set up .httaccess to subfolder

I have these structure on my FTP: one presentation (without .htaccess) second presentation (with .htaccess) - named "sec_pres" third pres. (with .htaccess) - named - "third_pres" How I should ...
0
votes
1answer
201 views

Mod_rewrite excluding files/directories but including .php files

The traditional mod_rewrite for routing is as follows: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L] ...
0
votes
0answers
232 views

apache mod_rewrite subdomain, domain and url arguments

I am trying to use mod_rewrite to capture a subdomain, domain, and the arguments passed with the url. I have multiple domains pointing to a single ip address, with both @ and * wildcard a-records, so ...
0
votes
1answer
1k views

Why isn't FastCGI able to properly process PATH_INFO rewrites?

My current host uses FastCGI for its PHP setup, and this is apparently causing some issues when a mod_rewrite directive redirects to a URL with a PATH_INFO portion. For example, there are issues when ...
0
votes
1answer
133 views

Why isn't excluding a folder in mod_rewrite not taken in account

I would like to exclude mod_rewrite for a certain directory. I want the folder "phd_application" not to be rewritten, that is, when a url points to www.myserver.com/phd_application it goes to ...
0
votes
2answers
333 views

mod_rewrite rule getting bypassed, .phtml files being shown as plain text

I have a problem with an old project for which I have the following mod_rewrite conditions/rules: RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond ...
0
votes
2answers
431 views

How to mod_rewrite on IIS webserver

As my previous server was a Linux powered machine I have this piece of code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond ...
0
votes
3answers
101 views

Directory agnostic Apache mod_rewrite rule for web applications

I'm in the process of developing a PHP application but I have limited working knowledge of mod_rewrite which I plan to use to create "pretty URLs". Whilst the application is in development I'm ...
1
vote
2answers
2k views

How to set mod_rewrite in WAMP?

I learn Symfony2 and i have: http://symfony.com/doc/current/quick_tour/the_big_picture.html http://localhost/Symfony/web/app.php/demo/hello/Fabien And if you use Apache with mod_rewrite enabled, ...
-3
votes
1answer
71 views

Display static pages with a RAND seed, expiry? [closed]

In Apache, is there any way (using scripts like CGI and PHP, etc.) that will fetch all static content (html, images, and files within a specified size range) and send it to the user as a randomized ...
1
vote
3answers
752 views

Is it possible to remove the .php extension WITHOUT using mod_rewrite?

I'm managing an e-commerce site for a customer that was built using JShop on Apache. For SEO reasons links are like: http://www.domain.com/shop/section/3151/1/flowers ...
1
vote
3answers
646 views

apache - forbiddend access to some static files

I'm having hard time with .htaccess directive. I'm trying to have URL rewriting for Codeigniter framework. Everything works as expected on the production server but i'm not able to set up properly my ...
0
votes
1answer
112 views

Mirroring my website through a secure subdomain

Attempting to get my site to comply with the limitations of an edge content delivery network, I have been forced to push my security certificate root from https://www.mysite.com to the subdomain ...
2
votes
1answer
493 views

mod_rewrite !-f and !-d ignored for .php extensions

I have an .htaccess file on an Apache 2 server: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
4
votes
3answers
5k views

Apache2: 400 Bad Request with Rewrite Rules, nothing in error log?

This is driving me nuts. Background: I'm using the built-in Apache2 & PHP that comes with Mac OS X 10.6 I have a vhost setup as follows: NameVirtualHost *:81 <Directory ...
1
vote
1answer
356 views

Make post title as a slug in url by mod rewrite

I have previously posted a question but I am not satisfied with the answers. I have a url, for example http://example.com/details.php?a=100&b=101&slug=power-programming-in-php I want to ...
0
votes
3answers
39 views

porblem in Mod rewrite url editing [duplicate]

Possible Duplicate: Make post title as a slug in url by mod rewrite I have a url: http://www.example.com/details.php?var=100&p=99 I want to rewrite it as using mod rewrite ...
0
votes
1answer
313 views

Htaccess: Rewrite a subdirectory within a domain to the main domain

I have to rewrite a sub directory to go the main domain. For example, I have www.mysite.com and I want to rewrite www.mysite.com/newersite to www.mysite.com This is what I used in my htaccess file: ...
0
votes
1answer
330 views

.htaccess mod_rewrite remove .php extension, but preserve URL path

I currently have PHP scripts that work properly, being called like this: www.example.com/user.php/paul www.example.com/tag.php/food I'm having trouble getting .htaccess to rewrite properly. I'm ...
9
votes
10answers
775 views

.htaccess doesn't redirect to www-prefixed page properly

I'm trying to redirect an url without www. to www.version (domain.cz to www.domain.cz). I use the usual RewriteCond %{HTTP_HOST} ^domain\.cz [nc] RewriteRule (.*) http://www.domain.cz/$1 [R=301,L] ...
0
votes
2answers
2k views

apache/mod_rewrite not configured properly?

Hey, guys. I decided to take a peek at a new MVC PHP framework FuelPHP and I appear to be having some problems with getting Apache (or is this a PHP config issue?) to handle the requests properly. ...
1
vote
1answer
408 views

mod_rewrite interferes with $_SERVER['REQUEST_URI']

I have an issue involving PHP and mod_rewrite. I am trying to load the page testwebsite.com/1. index.php <?php // get requested uri $uri = explode('/', ...
0
votes
1answer
197 views

Using ModRewrite to direct subdomains appropriately fails on MediaTemple

I am familiar with modifying htaccess files but my initial attempts to do so continue to fail. Ultimately, I want to point users to 'imaginary' subdomains (those which do not exist) so that the ...
0
votes
1answer
62 views

mod_rewite Rule: root/→ root/app/views/home/home.php

I am shocking at mod_rewite, here's the scenario: I need a rule that rewrites mydomain.com to mydomain.com/app/views/home/home.php. The rule, or set of rules rather, must also rewite ...
1
vote
2answers
768 views

Blocking a specific URL by IP (a URL create by mod-rewrite)

We need to block a specific URL for anyone not on a local IP (anyone without a 192.168.. address) We however cannot use apache's <Directory /var/www/foo/bar> Order allow,deny Allow from ...
0
votes
1answer
196 views

url rewrite to make generated thumnails cache like static, a syntax question

this is a pain in the ass-problem!! Given: most proxies, do not cache resources with a "?" in their URL even if a Cache-control: public header is present in the response. To enable proxy caching for ...
0
votes
1answer
95 views

Using Mod_rewrite to rewrite all requests with subdomains, what am I doing wrong?

I am trying to make it so that all requests that use a subdomain are rewritten in such a way that they are sent to the server as "regular" request without the subdomain. I have created the mod_rewrite ...
0
votes
2answers
1k views

How to rewrite query strings in url (\img?src=foo.jpg) into cachable urls (\img-foo.jpg)?

a question that is now partially resolved. A genius who can speak Apache fluently can shine light into this matter... GIVEN: Most proxies, do not cache resources with a "?" in their URL even if a ...