.htaccess

Apache URL Rewriting,

Hey folks, I am trying to get URL rewriting to work on my website. Here is the contents of my .htaccess: RewriteEngine On RewriteRule ^blog/?$ index.php?page=blog [L] RewriteRule ^about/?$ index.php?page=about [L] RewriteRule ^portfolio/?$ index.php?page=portfolio [L] #RewriteRule ^.*$ index.php?page=blog [L] Now the 3 uncommented re...

What would cause Rails page caching to stop working?

I've got a Rails app that has stopped caching somewhere along the way, and I'm not sure which revision along the way might have stopped it from working. I'm under the impression that page caching, when working properly, should never even hit Rails if it finds the cached file. However, when loading my page and monitoring production.log, ...

.htaccess Question

I have pages like this: page.php?id=1&name=whatever How could I transform this into... page/1/whatever ? ...

Could someone give me an example of a .htaccess that would remove www?

Could someone give me an example of a .htaccess that would remove www from http:// and https:// ? I want to remove the www from BOTH ssl & www:80 ...

make server auto-append @domain.com to ftp account

I have a client who, printed 10,000 advertisements with a specific password for an FTP account written on it lets say: horses1, for many reasons I have had to migrate her over to a new host, she chose mediaTemple, and bought an account. The Login is now [email protected], which is a problem, becuase of all her print ads. I'm think...

Permalinks not working for wordpress MU, images not showing up - .htaccess Problem

Hi, I moved 3 different wordpress installations to one single Wordpress MU. Every thing except Permalinks are not working and images are not loading on the webpages. Image URL style http://subdomain.domain.com/files/2009/05/image.gif I get 404. but if change i change it to wp-content/blogs.dir/4/files/2009/05/image.gif It works perfect...

Htaccess URL rewrite question

I have a challenge using Apache. In my .htaccess file I'd like to convert requests like this: url/portfolio/filename.htm to: url?filename Any takers? Thanks for your time ...

fixing cakephp .htaccess/mod_rewrite for shared hosting setups

I'm trying to install cakePHP on a shared hosting setup. After extracting the files to a location like ~/public_html/dev/cake and visiting the appropriate URL (in this case http://hostname/~username/dev/cake/), I receive a 404 error: Not Found The requested URL /usr/home/username/public_html/dev/cake/app/webroot/ was not found on thi...

Tricky URL rewrite, regex .htaccess

Hi, I have a tricky issue redirecting some urls internally for my site. The situation is this, I currently have a url like example.com/check/youtube.com which internally redirects to check.php?domain=youtube.com using the following mod_rewrite code: Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] Rewr...

Redirect 301 Transfer to New Domain Output URL is Ugly

I am moving my blog to a new domain. I am trying to do this through .htaccess. While the redirect is okay - the output URL is 'ugly' example in old domain .htaccess file: redirect 301 /archives/2009/06/02/hello-world/ http://indiapoint.net/archives/2009/06/02/hello-world/ So if we click http://www.i3pep.org/archives/2009/06/02/hello...

pre-compressed gzip break on chrome, why?

I serve pre-compressed CSS and JS files on my site, and IE6-8 and FF is working perfectly with my .htaccess file. # Compressed files RewriteCond %{HTTP:Accept-Encoding} .*gzip.* AddEncoding x-gzip .gz AddType application/x-javascript .gz AddType text/css .gz I call the files with the .gz extension already [example]: <link rel="styles...

Rewrite a request whether or not the requested file exists

I'm trying to convert all requests in the format: /portfolio/picturename.htm ('portfolio' is constant) to this: /?picturename So (thanks to users here) I have this solution which works for files that don't exist: Options +FollowSymlinks RewriteEngine on RewriteRule ^portfolio/(.+)\.htm$ /?$1 [R,NC,L] But: How do I also have th...

How to set up .htaccess for Kohana correctly, so that there is no ugly "index.php/" in the URL?

After 2 hours now I couldn't get it right. The Kohana installation is accessible directly under my domain, i.e. "http://something.org/" Instead of http://something.org/index.php/welcomde/index I want to have URLs like http://something.org/welcome/index My .htaccess is messed up completely. It's actually the standard example.htaccess ...

How can a URL like http://localhost/index.php/articles/edit/1/my-first-article work without an .htaccess?

I don't get this: http://localhost/index.php/articles/edit/1/my-first-article This URL is mentioned as an example in the Kohana framework documentation. I poked around in the files of my installation, and there is no .htaccess besides my own one that has nothing to do with that. So, how can it be that an index.php is called but then,...

How can I redirect every URL that's not requesting an JPEG or PNG image to index.php/x?

For example, I have an URL that looks for an image like this: http://example.com/img/foo.png http://example.com/img/interface/menu/bar.png http://example.com/static/users/avatars/small/3k5jd355swrx221.jpg I don't want to redirect those. They should just pass through. But then, I have URLs like this: http://example.com/reg...

htaccess Domain Simulation

I have a server that hosts stuff automatically from /var/www. I copied a directory like domain.com inside /var/www. I then added domain.com into my /etc/hosts for 127.0.0.1 (localhost/loopback). What's the .htaccess trick with Apache so that I can hit my site with: http://domain.com/ and it automatically knows to look in /var/www/domain....

Apache .htaccess vs httpd - does it really matter?

I know this question has been asked many times and I've researched it myself on Google as well but just can't come up with the answer I need. My hosting company is NOT letting me use the httpd config file, instead it wants me to use .htaccess. I am not a server admin but I have to believe that there is a performance hit for using this ...

Why is my WWW-Subdomain not indexed?

I am currently working on a project: BLZ-Aktuell When I am searching for site:www.blz-aktuell.de there are no results. If I do a search for site:blz-aktuell.de the search works correct. Do anyone know what this is about? Hint: I am using CakePHP, that needed to be added a htaccess file in the root directory. This is the source: <IfMo...

Need to alter regex to allow for special characters

Hi, I have the following bit of code in my htaccess that will allow a users ID to only be alphanumeric and include underscores and hyphens: RewriteRule ^([A-Za-z0-9_-]+)$ profile.php?ID=$1 [QSA,L] I've recently imported over 1000 usernames from a social networking platform that allowed usernames to contain special characters, but this...

Pretty URLs without mod_rewrite, without .htaccess

Without a possibility to access .htaccess I find myself in a creative impasse. There is no mod_rewriting for me. Nevertheless, I want to be able to do the nice stuff like: http://www.example.com/Blog/2009/12/10/ http://www.example.com/Title_Of_This_Page What are my alternatives? In respond to the answers: I'm building with php5 I ...