.htaccess

What is the .htaccess/mod_rewrite solution for this redirect problem?

(Please see important Additional information edited in near the bottom of question) I'm trying to get the following url http://www.example.co.uk/home/templates/cnb/fb_calendar/events/view/289 to redirect to http://www.example.co.uk/home/index.php?option=com_content&task=view&id=574&Itemid=85&direct=view:289 I t...

need to rewrite for a mobile controller in Kohana

I am trying to rewrite in htaccess mobile.domain.com/mobile/function into mobile.domain.com/function I thought the below would work but it thinks that the function is a controller. # Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase / # Protect hidden files from being viewed <Files .*> Order Deny,Allow De...

Password Protect Virtual Directory With .htaccess

I have a site with a virtual directory structure like mysite.com/folder/title which is actually a .htaccess rewrite to mysite.com/f/index.php?p=title. I want to password protect the folder folder with .htaccess, and know how to do that with actual folders. But I don't want to password protect the main site mysite.com, and right now if I ...

Block access to JavaScript file

Let's say I have a JavaScript file... using .htaccess is there a way I can make it so a user can NOT look inside the JavaScript file? ...

PHP sites as subfolders in a Drupal installation

I have a drupal site that was on shared hosting with other non-drupal sites. Of course there's a primary domain and subfolders. I recently moved the drupal site to be the primary domain, so all the other non-drupal sites are as subfolders. Since I've done this however, none of the other non-drupal sites is displaying. But when I di...

Multilanguage site, redirect based on cookie or accept-language (RewriteRule)

Hi, A few weeks ago i asked a question about a multilanguage site (see http://stackoverflow.com/questions/3439668). That works perfect (thanks for that) But since I want to make my website nicer and I started adding more languages a new problem showed up. I want to see if I can redirect users directly to the site in their language, if ...

ErrorDocument doesn't seem to be working in my .htaccess

Can anyone advise please? I'd like to have the default page for visitors to my site as being index.php and for all non-existent pages the visitor should see errordoc.php So I've put this in the .htaccess: ErrorDocument 404 /errordoc.php Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^mysite\.org\.uk$...

Simple RewriteRule question

Hi all, This seems so simple, but I can't figure it out... I would like all requests to be rewritten to index.php (which will interpret the request) apart from 404.html which should be rewritten directly to 404.php. The following code does work at rewriting everything to index.php, but 404.php never gets triggered. I have left line 3 ...

Ruby on Rails .htaccess issue

When I run newly created Rails application on Apache, I can only access it's default front page ( standard app/public/index.html) file. When I try to run custom method via URI I get page not found. So I'm guessing that something is wrong with my .htaccess. Do I have to "open" it for every controller? RewriteCond %{HTTP_HOST} ^example.c...

apache htaccess redirect many url to one

Sorry guys if this is a lame question, but the examples i found dont quite work the way I want What I'm tryint to achive is send any web site request for products to "producto.php" but keeping the descriptive URL for the search engines. This is the .htaccess I have RewriteRule ^en/products(/)?$ /en/products/tactical/ [R] RewriteRule ...

Mobile Redirect using htaccess

I have a website called www.website.org I have a mobile website called m.website.org I want to use an htaccess to automatically redirect the main website URL to the mobile version.. However, there is a link on the mobile version that points back to the main website called www.website.org?noredirect=true When I click the logo on th...

.htaccesss two sites

Hello. I have two sites running in the same domain (the same sites, but the old in wordpress and the new custom) I need to do: If the client ask for a file that exists, then he can see it: (this works) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Any other request goes to index.php RewriteRule . /index....

Htaccess redirect

Hi, I'm trying to install a Symfony based website on a shared hosting server. I can write into /www/ only. The problem is that Symfony will be in /www/web/ ; Is there a way to serve www.example.com/web/index.php/something when users ask for : www.example.com/index.php/something ...

rewrite htaccess url some questions.

i have a cms that is generating SEFURLs almost correctly. but there is a menu item called separator that you can use as a hook for javascript, which has no link on it. the url that gets created is http://www.mysite.com/separator/mycategory/mypage i want to get rid of the /separator so that the url looks like http://www.mysite.com/myca...

RewriteRule is breaking $_SESSION

Everything was working fine till I added my .htaccess file. What I'm trying to do is route all my users to their profile page. So www.darudude.com/user1 routes to www.darudude.com/userinfo.php?user=user1 My .htaccess file as this: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Re...

Can't get setenv to work in .htaccess

SetEnv doesn't seem to work for me. I tried this in my .htaccess: SetEnvIf Remote_Addr ^192\.168\.0$ ip_ok <IfDefine !ip_ok> AuthName "Guest Login" AuthType Basic AuthUserFile /opt/lampp/lib/ok_users/guests.users require valid-user </IfDefine> and I had to provide username/password credentials even though my ip is 192.168.0.10...

Password Protecting App in Development (Codeigniter)

Hello, I am developing a web application using CI at www.example.com . My CI install is located outside the www root folder. How do I go about password protecting my application while still allowing my "home page" (in this case the default controller/view in CI ) to be publicly accessible ? I.E. I want to develop my application withou...

redirect htaccess or php?

How do you do this... When the user enters http://domain.com/mycompanyname browser redirects to http://manager.domain.com/page.php?company=mycompanyname Note: mycompanyname value is dynamic ...

301 redirect question?

Is this qood example of redirection of page to another domain page: RewriteCond %{HTTP_HOST} ^dejan.com.au$ [OR] RewriteCond %{HTTP_HOST} ^www.dejan.com.au$ RewriteRule ^seo_news_blog_spam\.html$ "http\:\/\/dejanseo\.com\.au\/blog\-spam\/" [R=301,L] or good old works too: 301 redirect seo_news_blog_spam.html http://dejanseo.com.au/bl...

Mod rewrite multiple languages

Hi all, Alright im doing a site which is available in multiple languages. I have ran into some problems with my mod rewrite. I'm trying to do this: Normal page without extra querystrings: /en/whatever And the page with problems (with querystrings): /en/dashboard/project/projectid And my .htaccess: RewriteRule ^en/(.*)$ $1?lang=en [N...