mod-rewrite

mod_rewrite chaining?

I have a bootstrap php file that I am routing all requests through: RewriteRule ^(.*)$ index.php?query=$1 [L] Say I have a url like /books/moby-dick, but I need the URL to pass to the index file like /books/detail/moby-dick. Is there a way to "rewrite" /books/moby-dick to /books/detail/moby-dick before the last RewriteRule? I thought ...

remove query string key=value at webserver level (apache/nginx)

I would like to remove fb_xd_fragment from the query string and pass the rest of the request off to the application level. This is for an improved cache hit rate so doing this modification at the application level is not useful nor possible (trust me). Example of how to modify the query string using apache or nginx would be nice. Ex...

How to create the rewrite rule for the url where the parameter/arguments will contain the dynamic value?

I have a rwrite rule which is like this: RewriteRule ^30/edit-print-ready-vinyl-banners.html edit_print_ready_form.php?id=30 Now I need a Rewrite rule such that if i append the dynamic parameter say "pro_id" and "osCsid" to it likewise edit_print_ready_form.php?id=30&pro_id=51&osCsid=hdsfjhfkjhk11212jhkjkjhkjh Now if i use the rewr...

Create user page at subdomain

How to implement automatic page creation on a subdomain when a new user registers on the site? (Working in Python on the Plone CMS and Zope web app server) ...

How do I hide actual directories using mod_rewrite?

I am hosting a couple of domains of the same wordpress installation, now I'd like to have a per-domain folder for some various files I need to put up there. Essentially I want to map like this: URL Path webbfarbror.se/f/* _files/webbfarbror.se/* grapefrukt.com/f/* _files/grapefrukt.com/* This little sn...

Match subdirectories in .htaccess

Hi, I am trying to match a URL like: http://xy.com/test/abcd to a php script named test.php Here is my .htaccess RewriteEngine on RewriteBase / RewriteRule ^test.* test.php [L] This matches fine when I make a request with curl like: curl http://xy.com/test123 But it the rule does not seem to match the following call (getting a h...

how to redirect to current directory with rewriterule

how to redirect to current directory with rewriterule How can I redirect to current directory with rewriterule. example: http://www.mySite/directory/subdirectory/index.php now program is trying to goto vvv.mySite/index.php RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d ##RewriteRule . /index.php [L] RewriteR...

.htacess rewriting with the [P] proxy flag

Hello. I am trying to do an invisible (transparent ?) rewrite via .htaccess and the proxy flag. It works with the [R] flag but not with the [P] flag because it just gives a 500 error. The two domains are on separate servers and the mod_proxy module is enabled. Is my .htaccess correct ? Options +FollowSymLinks RewriteEngine On RewriteBa...

mod_rewrite + "pages/123/some-text" -> "showpage.php?index=123&title=some-text"

As the title says, how can I use .htaccess and mod_rewrite to change this? "pages/123/some-text" to "showpage.php?index=123&title=some-text" I have started with this: RewriteEngine On Options +FollowSymLinks RewriteBase / RewriteCond %{REQUEST_FILENAME} pages/(.*) RewriteRule (.*) /showpage.php?index=%1 [R] Which allows me to atl...

How to do url rewriting for zeus server?

Hello, My site is in zeus server. Now i need to redirect my site to secure site using https. I found that url rewriting code different for zeus server. How do i use url rewriting code? Any help will be appreciated. Thanks in advance. ...

How to redirect "/" to "/home.html" only if the file "/index.html" does not physically exists?

Hello everybody, I found a way to redirect (not load, but change the URL) "/" to "/home.html". And now I want to add a RewriteCond to avoid the redirection if the file "/index.html" exists. I tried (without the comments), but it didn't worked : # We check that we comes from "domain.tld/" RewriteCond %{REQUEST_URI} =/ # We check that ...

Redirect from one domain to another, without the user realizing it

Hey I have a bunch of domains on on of my servers. I'd like to be able to redirect some domains to a different domain without the user knowing, so not a 301 redirect. An example, redirect domain.com to masterdomain.com/sites/domain.com. So when visiting domain.com, the user would be displayed with the data on masterdomain.com/sites/do...

htaccess and mod_rewrite codeigniter

I am using codeigniter and below is my htaccess file. However, i want a single directory to be accessable outside of the codeigniter app via my domain.com/directory. the other directory is a forum not related to codeigniter. how would i set up a rule in htaccess? i dont have access to http.conf <IfModule mod_rewrite.c> Rewri...

RewriteRules for Symfony 1.4 running IIS6 with IIRF

I need some help translating the following mod_rewrite rules from a .htaccess file to IIRF (iirf.codeplex.com) format: RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work RewriteBase / # we skip all files with .something RewriteCond %{REQUEST_URI} \..+$ RewriteCond ...

Easy IIS7 Rewrite Redirect Question

Hi, I'm just getting to grips with IIS7 redirect and having problems doing something that should be really simple: I'd like to redirect all requests for domain.net/post and redirect to domain.net/blog/post and keep the parameters so example: www.domain.net/post/how-to-do-something.aspx -> www.domain.net/blog/post/how-to-do-something.a...

mod_rewrite and Dynamic Directory Structure

I'm building a page admin in php and have a function that lets me make pages children of other pages. With a recursive function (based on who is a parent of who) I end up with a list of links like: <ul class="navList" id="navList"> <li><a href="http://mysite.com/Home"&gt;Home&lt;/a&gt;&lt;/li&gt; <li><a href="http://mysite.com/A...

SEO for a Magento multilingual store

I’m trying to build a multilingual website (french and english) with proper SEO I’m using Magento 1.4.1.1 with the sample data & the default theme I’m testing locally (MAMP) on the domain : magento.dev (without the www.) So far I… - Installed the French language package - Changed the store view codes to fr & en - Set French as the de...

How do I add some static routes to a CodeIgniter app?

How do I configure a CodeIgniter app so I can have one directory that will just serve some static (not MVC) html? I want to handle some existing links, in the form of: http://mysite/contactform/contact.html?queryvars Anything in the /contactform directory including sub-directories (which is just some css, js, images,etc) should not go...

Dropping .htm from URL

I'm trying to create a mod_rewrite rule that will drop any .htm that gets appended to a url that gets put in. For example, if someone types in example.com/faculty/jim.htm, I want drupal to ignore the .htm and just go to the page example.com/faculty/jim. Any mod_rewrite experts out there that can lend a hand? Is there something I can alte...

Flash object won't recognize query string if set through mod_rewrite

If I load an SWF with a query string at the end, like: object.swf?this=that ... then "this" is properly recognized as a flashvar within the flash object. But, if I set "this" via mod_rewrite, as in: RewriteRule ^object$ lib/object.swf?this=that [QSA,NC,L] ... then "this" is undefined. I even wrote a little PHP script to dump the ...