Why is my mod_rewrite doing this?
add path info postfix: /home/mobelluk/public_html/about.php -> /home/mobelluk/public_html/about.php/
which results in an unwanted trailing slash on EVERYTHING.
I have disabled all my .htaccess rules so they're out of the equation.
...
I have a dispatcher function in index.php so URLs like:
/blog/show go to
/index.php/blog/show
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
How can I modify this so that I can dump all of my stat...
I am relatively new to mod_rewrite, but have a site which I would like to have "pretty urls." Similarly to SO :).
I am attempting to have things like: "http://www.whatever.com/search/test" get rewritten to "http://www.whatever.com/search.php?q=test" and have had some limited success. I believe that content negotiation is getting in my w...
I'm starting up a new web-site, and I'm having difficulties enforcing my desired file/folder organization:
For argument's sake, let's say that my website will be hosted at:
http://mywebsite.com/
I'd like (have set up) Apache's Virtual Host to map http://mywebsite.com/ to the /fileserver/mywebsite_com/www folder.
The problem arises whe...
I would like mod_rewrite in an .htaccess file to link to a mysql database to provide me with mapping information.
Specifically, I am using a single code base to host multiple sites so..if a user requests an image, for example:
http://www.example.com/images/car.jpg
this is going to hit my server and many other sites will also be hitting...
Hello,
I have some mod_rewrite rewrites that correctly redirect the URLs to a script. From within the script, I want to go to a different file without causing another request/changing the URL.
I have experimented with Location and meta refreshes but they are not as smooth as desired.
Is there a way to change to the script or even retur...
I have a rewrite rule of the following form:
RewriteRule ^foo/([a-zA-Z0-9]+)$ foo.php?arg=$1 [qsa,nc]
It takes urls of the form /foo/bar and changes them to /foo.php?arg=bar
It works properly locally, and it works on my old host but I moved to a new host (running ubuntu) and it behaves differently.
On the new host apache notices that...
I would like to have pretty URLs for my tagging system along with all the special characters: +,&,#,%, and =. Is there a way to do this with mod_rewrite without having to double encode the links?'
I notice that delicious.com and stackoverflow seem to be able to handle singly encoded special characters. What's the magic forumla?
Here'...
I am trying to do a regex match and replace for an .htaccess file but I can't quite figure out the replace bit. I think I have the match part right, but maybe someone can help.
I have this url-
http://www.foo.com/MountainCommunities/Lifestyles/5/VacationHomeRentals.aspx
And I'm trying to turn it into this-
http://www.foo.com/mountain-l...
I've got a small problem. I've got a good setup which mod rewrites all requests to the site - the only thing is it also rewrites directories which I don't want to be included.
I'm using this code in my .htaccess file:
RewriteEngine on
RewriteRule ^([^/\.]+)/?$ index.php?section=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?secti...
Recently I've added the tail of this file to optimize url's like site/5/john-doe[.php] instead of site/5/john-doe/[index.php], however, I rather like my custom error documents, and these modifications call a black & white "Internal Server Error" and "additional 404" error page. It might be helpful to know that most of the site will rema...
How can you use ModRewrite to check if a cache file exists, and if it does, rewrite to the cache file and otherwise rewrite to a dynamic file.
For example I have the following folder structure:
pages.php
cache/
pages/
1.html
2.html
textToo.html
etc.
How would you setup the RewriteRules for this so request can be send ...
On my site I have mod_rewrite rules to make the URLs more search engine friendly, and it all works fine on the frontend, but I'm getting errors in the error log like this
[Thu Jan 22 22:51:36 2009] [error] [client {IP ADDRESS HERE}] File does not exist: /{some rewritten directory}
The rules I'm using are rather simple, along the lines...
Most solutions I've read here for supporting subdomain-per-user at the DNS level are to point everything to one IP using *.domain.com.
It is an easy and simple solution, but what if I want to point first 1000 registered users to serverA, and next 1000 registered users to serverB? This is the preferred solution for us to keep our cost d...
RewriteEngine on
RewriteRule ^page/?$ page.php [L]
This ends up matching the url www.site.com/page// but internally it acts differently than www.site.com/page/ because the stylesheets and images no longer appear properly. Am I doing something wrong or is this just something I need to deal with if I don't want to go through a lot of tro...
I have a strange problem with mod_rewrite, the rules that are relevant here are:
RewriteRule ^(.*)\/igre\-(.*)\.php\?Page=([0-9]+)$ game.php?GameUrl=$2&Page=$3 [L]
RewriteRule ^(.*)\/igre\-(.*)\.php$ game.php?GameUrl=$2&Page=1 [L]
And a corresponding URL might look something like this:
example.com/miselne-igre/igre-shirk.php?Page=2
e...
I mod_rewrite my pages very similar to how SO does it. I have www.example.com/users/login/ which will internally use users.login.php which acts as a controller. I want to pass in a parameter as a page to redirect to once the login is complete.
If you pass in a relative URL you end up with a very peculiar looking URL because you are pass...
I'm trying to get mod_rewrite to work on a client's website who insisted that we use Godaddy web hosting. She's got a shared linux hosting account. Will mod_rewrite work (using .htaccess) and if so, how? I'm not sure if Godaddy uses Apache or not.
...
Hey there,
I'm not too inexperienced with ReWrite (not a master either, though) so I was hoping somone might be able to help me.
RewriteRule ^$ index.php?page=home [NC]
RewriteRule ^adm$ index.php?page=adm_home [NC]
RewriteRule ^adm/stats index.php?page=adm_stats [NC]
Above is a snippet of my .htaccess file. As you can see, when so...
So far I include everything in index.php:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]
There are also pages where I use $_GET like this:
SELECT * FROM news WHERE id = ".intval($_GET['id'])
If I want to view a news I type news?id=1
instead of ?p...