I have a web application that has one set of files used by 50+ clients and all the configuration for each site comes from a config.php file in their respective directories. This is accomplished with PHP parsing the URL. All this works fine, just having an issue with custom uploaded documents the client can do and are located in
/var/w...
I would like to translate or 301-redirect urls such as:
www.domain.com/example.html to www.domain.com/example
Here are the current rewrite rules:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
RewriteCond %{SERVER_PORT} 80...
I would like a simple help. I have a URL like this: /profile.php?id=<id>&name=<name>.
My .htaccess file like this:
RewriteRule ^profile/(.*)/(.*) profile.php?id=$1&name=$2
So I have a end URL like this: /profile/<id>/<name>.
I can make /<id>. But how can I get a URL like /<name>?
I can use the RewriteCond to make a conditional?
I s...
hello,
in the following .htaccess file...
RewriteEngine on
RewriteCond %{HTTP_HOST} ^getpearson.com$
RewriteRule ^/?$ "http\:\/\/www\.getpearson\.com" [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^rede...
Hi,
I have a list of rewrite rules, but one of the rules is applying to something I need it to not apply to.
Here is the rewrite rule causing the problem,
RewriteRule ^([^/]*)/$ /category.php?category=$1 [L]
It's meant to rewrite .com/catname/ to /category.php?category=catname which it does fine, but I need it to not apply to anythin...
I have the following RewriteRule:
RewriteRule ^/people/([A-Za-z0-9\-\_]*)/?$ /people/people_details.cfm?person=$1 [I,L]
...it works great for forwarding my rule, but I want to make sure that the regex only picks it up if it has more than one character. So really, I need to have my regex...
[A-Za-z0-9\-\_]+
...have an additional r...
I'm having a strange .htaccess issue. My web structure is setup like so to have two sites:
www/site1/
www/site2/
inside the site1 directory, I have a .htaccess file with rewrite rules in it. Inside the site2 directory, I have a different .htaccess file with different rewrite rules.
My problem is that the rules in www/site1/.htacces...
I have to add a password protected zone to a site I am working on (using the .htpasswd file). The thing is the whole directory structure it's being pointed at doesn't exist and is created through mod_rewrite.
Will it still work, or does the directory actually have to physically exist on the server?
Clarification:
While I may need to p...
When I use this rule:
RewriteRule ^Chats/([^/]+)/?$ Chats/ChatPage.php?chaturl=$1 [NC]
I get $_GET["chaturl"] as ChatPage.php where I should get $1.
How can I solve it?
If alias and directory name are not the same, there is no problem. If I use
RewriteRule ^Chat/([^/]+)/?$ Chats/ChatPage.php?chaturl=$1 [NC]
(NOTICE IT'S CHAT NOW NOT CH...
Hi, I'm trying use mod_rewrite to rewrite URLs from the following:
http://www.site.com/one-two-file.php
to
http://www.site.com/one/two/file.php
The folders don't exist, but "virtually" exist for the rewriting purpose.
What rule do I used in this?
...
Hi,
I need a rule and condition to handle this scenario:
User from US visits www.domain.com, domain.com, www.domain.com/ or domain.com/ this should be redirected to www.domain.com/usvisitor/
However, if a user from the US visits www.domain.com/anydirectory it will let them straight through without a redirection occurring.
eg.
Rewrit...
I have a very heavy htaccess mod_rewrite file that runs my application. As we sometimes take over legacy websites, I sometimes need to support old urls to old files, where my application processes everything post htaccess.
My ultimate goal is to have a 'Demilitarized Zone' for old file structures, and use mod rewrite to check for existe...
Hello! My problem is as follows: I have JBoss 4.2.3 application server with AJP 1.3 connector running on one host under Windows (192.168.1.2 for my test environment) and Apache 2.2.14 running on another FreeBSD box (192.168.1.10). Apache acts as a "front gate" for all requests and sends them to JBoss via mod_jk. Everything was working fi...
Hi,
I have https on my site.
Pages with rewritten URL in my site are inaccessible while direct urls (folders).
here's the htaccess
## 2009-12-17 16:52 JGC [START]
## Enable http compression for this site
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
## Directive "DeflateCompressionLevel" not allowed in .htaccess, only valid in...
Hi all!
I've got a cms-driven website, with no option to change the code. What I want to accomplish is creating friendly url's, using only apaches mod-rewrite engine.
The problem is I'm creating an infinite loop, because I first redirect the original url (index.php?id=21) to a friendly one (/friendly/) and then rewrite the '/friendly' ...
I have used the Apache Mod Rewrite for PHP but not in IIS.
BACKGROUND:
I have inherited over 400 sites on IIS with PHP all with a copy of the identical code base.
The current code base has a unique connection string per client and that is why it was copied over and over again.
Each being a subdomain pointing an individual site in IIS:...
Hi,
I'm getting crazy with .htaccess and rewrite rule.
I'd like to understand how it works, I hate it, anyway here's my problem.
(really simple for most of you)
My site has one main page index.php.
This is the only page, all the others are handled by this one.
I did a simple RewriteRule:
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?page...
I have a (wordpress) blog where after commenting the users are redirected back to the page with an anchor to their comment. Should look like this:
http://example.org/foo-bar/#comment-570630
But somehow I get a lot of 404 ins my logfiles for such URLs:
http://example.org/foo-bar/%23comment-570630
Is there a way to write a .htaccess re...
Hi,
I'm trying to rewrite the following url:
index.php?route=checkout/cart
to
/cart
using:
RewriteRule ^index.php?route=checkout/cart$ /basket [L]
However it doesn't seem to work. Anyone know what I'm doing wrong?
Thanks
...
I have my mod_rewrite set up so that it redirects all requests that aren't targeting existing files or directories to index.php?req=* where * is the request.
Works all fine but when I send the browser to something like this:
http://myurl/A/B/C
The browser tries to find all images, stylesheets in the non-existing folder C. How can I m...