mod-rewrite

Doubt about url rewriting using apache mod_rewrite

Hi everybody. I have a doubt about url reqriting using apache mod_rewrite. I am a newbie in mod_rewrite and I dont have any experience in regex. What I want to do is to: Rewrite / To /web/content/public/ Rewrite /clients/ To /web/content/clients/ How can I acheive above things. I tried: <IfModule mod_rewrite.c> Options +Fo...

Apache mod-rewrite for shorter urls

...

Mod-Rewrite for large sites...how much is too much?

I have a huge site with lots of different functionality...and I really want to have beautiful url's throughout. The problem is that my Mod-Rewrite has become a monster of its own...most of the sections have different URL needs, directory depths, etc. How many rules are too much? and what is normal? Is it better to simply mod-rewrite th...

mod_rewrite involving query string

I'm struggling with a mod_rewrite problem that involves .css files that are dynamically served by a "program" that reference images. I say "program" since the the tech stack is a bit obscure, but just insert your favorite technology there [perl | php | java]. The CSS file is referenced from the page using the following URL: http://s...

Mod Rewrite with Joomla

Basically I have a joomla instance with an article that uses URL rewriting. http://example.com/kids-and-family/185-summer-camp.html goes to the corresponding article when typed into the url. I now want this URL to be accessed by using http://example.com/camp This seems to be the bulk of the .htaccess file: ########## Begin - Joomla!...

Apache/Tomcat site nesting

Hello, I have two standalone sites in tomcat webapps folder $TOMCAT_HOME/siteA which is registered in DNS as siteA.example.com and $TOMCAT_HOME/siteB which is NOT registered in DNS Both sites are written in Java/Servlets. Is there a way to setup apache/tomcat/mod-rewrite to call siteB like so? siteA.example.com/siteB Does this l...

mod_rewrite not using multiple rules

I'm still pretty lost with mod_rewrite as its incredibly new to me. I'm trying to set up a few rules for better urls. However, after playing around with it for awhile it appears that it only ever uses the first rule listed. For example, if i go to "/frontpage/some-post-slug" it works perfectly but if i go to "/page/some-page-slug" I get ...

mod_rewrite not working consistently

I've got a rewriting scheme going on that was working fine. Basically, anything in the url is passed as a querystring to index.php, so /dave/bob is rewritten to /index.php?page=dave/bob. I deal with the parsing of this in index.php. Here's my .htaccess: RewriteEngine on RewriteRule ^([^\.]+)?$ index.php?page=$1 [L] The problem I'm hav...

mod_rewrite and hyperlinks

Hi Guys, I'm trying to get my head around mod_rewrite and friendly URLS. OK, on a very basic level I have the following rule: RewriteRule ^register$ register.php [L] This allows me to browse to www.mydomain.com/register The hyperlink within my pages shows register.php. Do I have to manually change my links to register? Esentiallly...

mod rewrite everything but one request_uri

Hey all, I'm running a project site that has a zend framework in one folder, and a Project Pier (sort of Basecamp) install in a completely different folder (because it was installed way earlier, initially running from another domain). The domain I registered for this project redirects to the zend/public/ directory with the following ru...

Mod_rewrite Question

I have an HTML file I want rewritten as a subfolder on the server. http://www.example.com/kids-and-family/185-summer-camp.html to be shortened to: http://www.example.com/camp Is there an rewrite condition where I can make this happen in .htaccess? Can I say if (/camp) then display /kids-and-family/185-summer-camp.html? I have been ...

.htaccess URL rewrite help!

Hi guys, I am using .htaccess and mod_rewrite in my little PHP framework. It's working nicely, but I want to expand on just having it redirect everything to index.php. My directory structure is something like this (obviously simplified) apps media system -- admin jscript templates My current rewrite rules is: RewriteEngine On Rewri...

.htaccess mod_rewrite - how to exclude directory from rewrite rule

Hello all! I have 8 lines of rewrite rules in my .htaccess file. I need to exclude two physical directories on my server from these rules, so they can become accessible. For now all requests are sent to index.php file. Directories to exclude: "admin" and "user". So http requests: http://www.domain.com/admin/ should not be passed to ...

mod_rewite advice

Hi Guys, I was wondering if you could advise if there is a more efficient way of writing what I have below? Could this be acheived in the 1 rule? RewriteRule ^search/(cars|boats|plant)/([-a-zA-Z0-9]+)/type-([0-9]+)/price-([0-9]+)-([0-9]+)/?$ search.php?category=$1&location=$2&type=$3&minprice=$4&maxprice=$5 [L] RewriteRule ^search/(car...

rewite rule for two folders

Hi, I'm migrating my web from Joomla to Wordpress, in order to do so I need to set up access to a new subfolder to install wp. I have a htaccess file redirecting actual Joomla app to subdirectory /joomla/ I need access to /wp/ to set up and test before deleting /joomla/ directory. actual htaccess: <Files php.ini> order allow,deny de...

Setting a default Apache RewriteRule entry

I want to set a 'default' rewrite rule to catch anything that didn't match the previous rewrite entries. I've tried this: RewriteRule ^(.*)/?$ index.php?url=$1 [L] But the output returned is: url = index.php Ideally what I want is to attach all the GET values to 'url' so they will be saved to my web log. Anyone have any suggestions...

Simple Help with htaccess

I need some help with a redirect: How do I take any URLs with www.example.com/blog/ and anything else after it, (.*) and strip it down to just the text after /blog/? I've never really done rewrites, so please help. ...

Using URL contents to send data(post or get) to a PHP page.

OK, I am creating a questionnaire application that is managed by a single user on /manage. There, he can create multiple questionnaires, each with a different name and set of settings(registered users, questions, data, etc.). Currently, the different tests are accessed by non-administrative users(the takers of the test) by going to /inde...

mod_rewrite trailing slash with RewriteCond

I have searched through the related mod_rewrite qustions but I can't anything specific enough so I'll post: Heres my rule that adds a trailing slash: RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L] Only I want to exclude one specific directory eg. /mydirectoryname/ and not add the trailin...

301 redirection help on wordpress

Hello all friends, I'm searching for a 301 redirect rules in .htaccess for the last one week. I have visited many similar pages here too. But all are not working for me. So I'm asking help from masters like you. I'm using wordpress blogging platform. Before I was using Joomla and that time so many 404 errors was there on my website. T...