I just recently ported over my source code to Ubuntu Server from Windows and I've been having a few .htaccess mod_rewrite problems. I have mod_rewrite enabled for Apache. Here is my current .htaccess
RewriteEngine On
RewriteRule ^css/default/?$ css/default.css
RewriteRule ^user/?$ user.php
RewriteRule ^user/([A-Za-z0-9_]+)/?$ user.ph...
Codeinginter provide .htaccess file as explained below. It is from CI User Guide.
However when I add this file in xampp/htdocs/mycodeigniter, and point to http://127.0.0.1/mycodeigniter/somepage, it goes to http://127.0.0.1/xampp which is the root file in htdocs.
How can I fix the file so that it points to http://127.0.0.1/mycodeignite...
Hi. How do you write rules to redirect all requests to *.php and *.html files in upload/ folder to a text file name forbidden.txt in root www folder. What I'm trying to do exactly is preventing script execution in this dir by redirecting those requests to the text file
Note: The upload/ folder is accessibly by ftp used by a group of peo...
I have a page called category.php5 that uses $_GET["category"] to fetch the right content from the database. I want to pretty it up so is looks like:
sinaesthesia.co.uk/category/psoriasis
which would equal:
sinaesthesia.co.uk/category.php5?category=psoriasis
I have successfully done this sort of rewriting before, but since I can't ge...
I am trying to mod-rewrite based on a sub-domain. How do I take the subdomain and append it to the end of my new domain?
Example:
RewriteCond %{HTTP_HOST} ^users\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/?subdomain=[variable for sub] [L]
How do I get 'users' into [variable for sub]?
...
I have a need to mod-rewrite my domain based off of subdomains...there are two scenarios in which i would need to do this:
my site is located in different cities...so losangeles.example.com should localized to los angeles, etc...essentially rewritten to www.example.com/?loc=losangeles
i want to allow users to create username.example.co...
I created a 401 page, which is html, and within an accessible directory.
It displays in IE 6, Firefox, Safari, but not IE 7.
Here is the .htaccess file for setting the authentication on the directory and location for the 401 page.
KrbServiceName HTTP
KrbMethodNegotiate On
KrbMethodK5Passwd On
#KrbVerifyKDC on
KrbSaveCredentials off
Kr...
Hi.
In my root web folder I have a list of folders (files, modules, classes) that I'm using .htaccess to prevent access to. However, in the modules/ folder, there are modules that carry their own images, which I'd like to allow access to.
How do I allow access to images in a folder under modules/, but still prevent accessing any other ...
Here's what I have now:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)(.*)$ /$3?$1=$2 [N,QSA]
This turns www.any.com/x/20/y/30 into www.any.com/index.php?x=20&y=30
(while ignoring existing directories - thank you so much Gumbo!!)
RewriteRul...
I have several rewrite rules in my .htaccess file that all work fine and I want to add a specific case to turn
sinaesthesia.co.uk/category/psoriasis
into
sinaesthesia.co.uk/category.php5?category=psoriasis
So I tried:
RewriteRule ^(.)category/(.)$ /$1category.php5?category=$2 [L]
which doesn't work. I've tried it without capturing...
vi .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|audio|editor|upload|images|js|css|robots\.txt|sitemap\.xml)
RewriteRule ^(.*)$ /index.php?$1 [L]
When I try to browse http://wolaitiao.cn/install,it reports 404,so it's not working correctly.
Is it because it's a VirtualHost?
<VirtualHost *:80>
...
...
When I upload an .ICS file to the server and try to download it, it appears as text. I would like the "Save as" dialog to appear so that the user can open the file as a binary in Outlook.
What can I put into the apache conf or .htaccess rule to make the headers for ICS files work like a binary. Example: A .doc file opens like a binary...
I currently have:
RewriteRule ^scripts/(.*\.js) /combine.php?type=javascript&files=$1
Current scripts folder looks like:
scripts/
folder1
f1.css
folder2
f2.css
folder3
f3.css
bespoke
bespoke.css
css.ss
I would like this rule to exclude anything within the scripts/bespoke/ folder. ...
I started a blog and when I changed my permalink structure to /%postname%/ I get a Page Not Found error. I want my url to look like this:
http://bobbybeckner.com/sharepoint-list-and-linq-using-jquery-and-ihttphandler/
not this:
http://bobbybeckner.com/index.php/sharepoint-list-and-linq-using-jquery-and-ihttphandler/
I read a few pos...
I'm a mod_rewrite noob and I'm getting a headache trying to figure out something that should be simple. What I'm trying to do is strip out unwanted variables from a URL displayed after a GET form is used. In other words, I'm trying to change this:
stats.php?gender=W&team_id=88&btnGet=Get+Stats
to this:
stats.php?team_id=88
Please...
I have publicly accessible files on my webserver. I'd like to enable AutoIndexing (Options +Indexes) but I'd like to require a password in order to view these listings. I have no problem setting up the Auth but there are complications with the public files and the DirectoryIndex files in that if someone also asks for a directory, and t...
I'm wondering, if I have an .htaccess rewrite setup on a virtual subdomain, ie. bm.example.com that has a rewrite to www.example.com/index.php?u=someId and I have an SSL certificate on www.example.com, will I run into problems if I try and access https://bm.example.com?
...
I have a folder full of 2000 images, all unique and named like this:
/images/0001.jpg (... 2000.jpg)
I need to be able to access 100 random, unique images. Something like this:
/sets/0001/001.jpg (... 100.jpg)
I need hundreds of "sets of unique images" like this.
I made one example set using a folder and a htaccess file with 100 lin...
I am moving my site to new domain. Need to redirect pages
from
old-site.com/oldpage.php?id=X
to
new-site.com/newpage-X
(X is number)
Why this rule does not work?
RewriteEngine on
RewriteRule ^oldpage.php?id=(.*)$ http://new-site.com/newpage-$1 [R=301,L]
...
How can I rewrite the following URL:
http://www.myurl.com/job/Accounting-Clerk-at-Department-of-Workforce-Services-in-Salt-Lake-City,-UT-1b6117567108f5a2
Into these components:
query = Accounting Clerk;
cmp = Department of Workforce Services;
location = Salt Lake City, UT;
key = 1b6117567108f5a2;
To get this result:
index.php?q=$q...