mod-rewrite

Code Igniter url routing question (using trailing slashes)

I am brand new to codeIgniter. I am very particular about urls on the sites that I develop. Is it possible to create these sorts of urls? Generally sites I develop have an integrated admin interface as well with new, edit or delete added onto the end of the url following a slash. Here are some hypothetical examples (one with an admin ...

Using mod_rewrite to add a directory.

Hi, I have a client which requires their site to be on: www.clienturl.com/asubdirectory The site that will be stored in the sub directory won't be able to have the links updated to: www.clienturl.com/asubdirectory/a_file.php They'll just be: www.clienturl.com/a_file.php But clicking these links would redirect or rewrite the user t...

php apache url rewrite

I have an url with the following format: domain/product.php?name=product a Now I need to rewrite this to: domain/product a(including the space in the word) like: http://www.directline-holidays.co.uk/Costa Blanca How do I do this? The closest result I got so far is the following: domain/p/product-a With the following code in .htaccess ...

.htaccess rewrite rule

I am attempting to have the following url http://mysite.com/orders/10000111 rewritten to http://mysite.com/orders/details.pl/10000111 Here is what I have in my .htaccess RewriteEngine On RewriteBase / RewriteCond %{SCRIPT_FILENAME} ^orders\/([0-9]+) RewriteRule ^orders\/([0-9]+)$ orders/details.pl/$1 [NS,NC,QSA] Can someone help out...

Mod Rewrite path issues

I have successfully created rewrite rules to handle URLs like http://example.com/xyz http://example.com/xyz/ http://example.com/xyz/abc http://example.com/xyz/abc/ Here is the mod rewrite & regex: Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Rewrite...

URL/Apache redirection question. (domain+directory redirect to sudomain)

Hello, I have been trying to figure this out for about 2 hours now. A new requirement came up where it was asked of me to try to find a way to send requests from foo.bar.com/blah to blah.bar.com. Technically /blah doesn't exist, but I was hoping to have the server redirect before it gets to that point. Has anyone had to do this before...

apache modrewrite refactor question

Is there a way to refactor this to use the same rule? I have a production site and a staging test site. test site RewriteCond %{HTTP_HOST} ^test.example.com$ RewriteCond %{REQUEST_URI} admin RewriteRule ^(.*)$ test-admin.blurb.com$1 [L] production site RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteCond %{REQUEST_URI} admin R...

IIRF redirect combine rules?

I have 3 "rules". One to make sure URLs are lowercase another to include a slash at the end of directories, and a 3rd to force access to index.html pages to be thru the directory instead. The problem w/ how I have it is, sometimes this is causing multiple 301 redirects. I'd really like each rule to apply in turn and then if neccessary r...

can you get me * out aaa.*.domain.com using regex ?

Hi, No matter how hard I try I can't get this.. This matches the whole domain only when it's format is aaa.bbb.ccc . ^[^.]+\.[^.]+\.[^.]+$ Our domain name is static (domain.com). So this needs to select * out aaa.*.domain.com. aaa may or may not be there. Thanks! ps: sorry for aaa part being unclear. it's another unknown. so it i...

Mod Rewrite ignoring -d

After a day or two, I am still fighting with Mod Rewrite. It seems that 60% of my development time is spent battling the server. My current URL structure is such that all http://example.com/xyz and http://example.com/xyz/abc should be handled by index.php. The problem is I have a http://example.com/admin/ section, which is a real direct...

problem with RewriteRule and apache

I have a SSL certificate that is registered to my www domain, but all my urls point to my domain without www. i tried this sentence: RewriteRule ^[https://mydomain.org](.*)$ https://www.mydomain.org$1 [R=301,nc] but for some unknown reason, it also redirects all the calls made to http://mydomain.org as well. i realy cant think of a re...

htaccess file adds the virtual directory address to the url

I wrote a script to add shtml extension to all requests that don't have it. This is it: Options +FollowSymlinks <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} htmlTemplates RewriteCond %{REQUEST_FILENAME} !\.shtml$ RewriteRule ^.*/(.*)$ $1.shtml [r,nc] </IfModule> I tried it on my local server, w...

Apache 2 Upgrade Killed Our .htaccess, Can't fix, please help!

We were forced to upgrade to Apache 2 today and as soon as we did our rule set that was working for months stopped working. The behavior it shows is completely ignoring the .htacess, even after we delete it (.htacess) the server seems to use a "phantom" rule. IE: site/stuff/ without .htacess should show a 404... but instead it goes to ...

Is there a better way to handle authentication?

Right now I have a server set up for multiple clients: clientA, clientB, clientC. Each client has their own users. The way I have it setup is clientA goes to http://www.site.com/clientA and is presented with a login screen which is triggered by an .htaccess file in a directory called /clientA. The .htaccess file has rules which direct...

Friendly urls not working - modrewrite enabled. what gives?

Hi, I'm trying to install SilverStripe and during the installation, it returns an error saying that friendly links aren't working. However mod_rewrite is enabled and AllowOverride is set to All. I'm using CentOS Linux on a dedicated server with Webmin as the cp (yes, I know.. not my choice). ...

howto mod_rewrite every request to index.php except real files but exclude one real directory?

Let me explain my situation: I'm using a MVC framework (CodeIgniter), so every request gets rewritten to my index.php file, which in turn routes this to my classes and functions. Offcours if there are requests for real files they should not be processed by scripts but directly send from webserver to browser. Owkay no problem, the fol...

Ignore symlinks in clean URL's in .htaccess

Example URL: example.com/user /user is both a symlinked directory and a valid URL to content on my site. I user Horde Routes to request the content and all requests to the site go through index.php. I currently have a .htaccess file that looks like: Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com$ [NC] ...

Apache Mod Rewrite: RewriteRule with L argument. What's wrong?

Hi, I'm developing a php application and I have a little issue with Apache and Mod Rewrite. Anyone knows what's wrong here?: RewriteEngine on RewriteBase /mysite/ RewriteRule ^css\/css\.css css/css.php [L] RewriteRule ^js\/js\.js js/js.php [L] RewriteRule !^img\/.* index.php When I put http://localhost/css/css.css appears index.php, m...

mod rewrite problem with 2 parameters

I'm trying to rewrite the categoy file of my shop system, I also integrated a pagination so I need to rewrite 2 parameters. it almost works, otherwise I wouldn't be posting in here this is the rewriteurl RewriteRule ^shop/cat/(.*)/page/([0-9]+)$ /cmstut/shop/cat.php?cat=$1&page=$2 [QSA,L] This is the url http://localhost/cmstut/sho...

trailing slash gives internal server error

I want all my pages to work if the user added a trailing slash in the end or not the following line works RewriteRule ^index/page/([0-9]+)/?$ /cmstut/index.php?page=$1 [QSA,L] but the the following line cause an internal server error, It's the last line That's the line that should rewrite all other pages which have no attributes like...