mod-rewrite

Google Chrome forces download of PHP scripts' source

I'm experiencing a behaviour of Google Chrome (Google Chrome 7.0.517.41 beta) that I can't understand. In some cases, Google Chrome downloads the source code of the PHP script that is requested from my server instead of it being executed. I don't have this problem with cURL or Firefox; when I request the same URL with them the script is ...

Apache: Friendly URLs and mod_rewrite help

Hi, On my site I have pages like "shoutbox", "admin", "blog" etc. I want the url to look like this: http://localhost/shoutbox/post Instead of: http://localhost/index.php?page=shoutbox&action=post Then I'll have PHP grab the string and explode() it seperating each part, grabbing the values between the "/"'s and then use the values...

HTACCESS - Block everything but specified SEO friendly URL

Hi, I haven't found all the answer to my current problem. Here is the root of the site: cache img display.php admin.php What I need is to block all the direct access of the files and allow only access via url formatted like that: 1 ht*p://sub.domain.com/image/param/size/folder/img.jpg (param, size, folder, img are parameters) 2 ht*...

Quickest way to rewrite urls to lowercase?

I'm looking for a way, preferably with .htaccess to rewrite a url when a user types in something with a capital. For example, the url could be website.com/pagename and the usertypes in website.com/PageName or website.com/PAGENAME Whats the best way to do with without slowing down page load? ...

SEO Friendly URL to Dynamic Arabic Category URL using PHP

Currently I have a url like this domain/index.php?cat=مال_وأعمال I want to set things up so that our Marketing people can publish url's like domain/مال_وأعمال I've tried several solutions including: mod_rewrite - the problem with this approach is that it becomes a huge .htaccess file since we need to write a rule for each category....

some issues with removing www and redirecting index.html

Hello Fellas, I am having trouble doing what i want to do with the following setup. I would like to remove all WWW, and also forward index.html to root dir. I would like this to be for all domains, so i am doing inside httpd.conf directory directive. I tried many variations with no success. Latest version is below (domains are inside ...

Apache rewrite rule

I am a rewrite newbie, I am wondering why this rewrite rule is not working, it ceases Apache from starting RewriteRule ^([-a-zA-Z0-9_]+)?/constant/([-a-zA-Z0-9_]+)/(.*)$ http://$2.domain.com/$1/$3 [R=301, NC] What this rule should do is URL refactoring, examples: http://www.domain.com/controller/constant/variable/action should be red...

Where is the proper place for mod_rewrite entries?

Hello fellas, For the love of God, I can't seem to get this mod_rewrite working properly. Instead of doing brute force trial-and-error, let me ask here. I want mod_rewrite rules to apply to ALL domains. I want mod_rewrite entries in httpd.conf I want to get rid of this WWW virus (for SEO purposes): http://www.example.com > http://ex...

PHP/Apache: GET Request Doesn't Exist?

Hi, Basically I have the following in my .htaccess file in the root of my site: Options -Indexes <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?route=$1 [L,QSA] </IfModule> In my PHP script when I use $_GET['route'...

mod_rewrite 301 redirect from old url to new codeigniter

Hi I have updated my website to now use the codeigniter framework my new urls are like the following example.com/index.php/home/page/page-title The old urls are example.com/index.php?option=com_content&view=article&id=249 Ideally I want to do a redirect for all links formatted in the old way to the new links but there are a lot of pag...

Can .htaccess rewrites request files outside of the htdocs/httpsdocs area of a server?

On my server, a website resides within a directory similar to /domains/domain.com/public_html. I wish to keep the domain at this path, as all the main files are there, but is there any way to source some files from another location in my server, eg. /global/script.js? In short, I hope to write a mod-rewrite than can source specific file...

.htaccess exclude specific file in webroot from URL rewriting

Hi all, i am running a site with joomla. It has a bunch of mod rewrite rules i don't totally understand.. as well as some kind of SEF link thing running. i have a specific page named sched.html that i need to serve up and be completely ignored from the .htaccess. I have tried everything i can possibly think of. including a number of re...

apache records in url

I've been seeing this type of url: http://someurl.com?someid=4387&amp;anotherid=1234&amp;yetanother=7365456 And I've seen a modification of that url like this: http://someurl.com/4387/1234/7365456 Also I think I've seen it like this too: http://someurl.com/4387/1234/?yetanother=7365456 What exactly is this called? And is thi...

Lighttpd configuration, . (dots) in my query string cause 404

Hi, I have an address on my site like so: http://www.example.com/lookup?q=http%3A%2F%2Fgigaom.com%2F2010%2F10%2F10%2Fangry-birds-for-windows7-phone-dont-count-on-it%2F In this example, the dot in the 'gigaom.com' part of the query string is screwing with lighttpd and my rewrite rules. I get a 404 with the dot in, no 404 if I take the d...

Rewriting static files in .htaccess

Hello, I have application in subfolder http://example.com/some/other/sub/folder/. And .htaccess file: RewriteEngine on RewriteBase /some/other/sub/folder RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?p=$1 [QSA,L] Template files contain absolute URL to the ...

mod_rewrite - redirecting to several different PHP files

I want any request to /files/ to be redirected to one php script, and all others (that aren't for specific file types) to be directed to another. No matter what I try I can't get this to work. This is from my apache2 virtual server config file: <Directory /var/www/test/public> RewriteEngine On RewriteBase /files RewriteRule ~files/(.+)...

htaccess for static files in subdomain

Hey, I have the following in the htaccess of my main folder Options +FollowSymLinks RewriteEngine on RewriteRule ^css/(.*)\.css$ - [L] RewriteRule ^(.*)\.css$ - [L] The second rule works fine. That is, the CSS files in the main directory are accessed directly. However, this was not propagating to the directory "css". Hence I created...

My mod_rewrite rule is wrong, I can't seem to figure out how to write it to work for me.

Here is my current .htaccess file: (it is running on my personal WAMP server. And Mod_Rewrite is enable on my server.) <IfModule mod_rewrite.c> Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteBase /rdypages/ RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ /...

Possible to 301 redirect using apache mod_rewrite to url with scheme that is not "http" and "https"?

Trying to do a 301 redirect using apache mod_rewrite: RewriteRule /the-path/(.*) my-scheme://new-site.com/the-path/$1 [R=301,NC,L] The path http://site.com/the-path/param1=xyz will redirect to http://site.com/my-scheme://new-site.com/the-path/param1-xyz But when I use "http" or "https" in place of "my-scheme" in the rewrite rule, i...

Can you explain the outcome of this Apache setup?

I had a very strange behavior with my Apache setup and then fixed it, however I would like to understand what really happened. My httpd.conf LOOKED like this: <VirtualHost *:80> ServerName mysite.com ServerAlias www.mysite.com ... <Directory "/path/to/mysite.com"> </Directory> </VirtualHost> === THEN, I wanted to add a 2nd d...