.htaccess

On a LAMP server, I want the URL http://example.com/index.php to be rewritten to http://example.com. How do I do that?

On a LAMP server, I want the URL http://example.com/index.php to be rewritten to simply http://example.com My current .htaccess file is as follows... IndexIgnore * ErrorDocument 400 /index.php?module=error&action=error ErrorDocument 401 /index.php?module=error&action=error ErrorDocument 403 /index.php?module=error&action=error ErrorDo...

Apache .htaccess to redirect index.html to root, why FollowSymlinks and RewriteBase?

In order to redirect all somefolder/index.html (and also somefolder/index.htm) to somefolder/ I use this simple rewrite rule in Apache .htaccess file: RewriteEngine on RewriteCond %{THE_REQUEST} ^.*\/index\.html?\ HTTP/ RewriteRule ^(.*)index\.html?$ "/$1" [R=301,L] This works well! But at Google groups they suggest to add also: Opt...

.htaccess php progress.

Thanks to the people that've helped me so far with this, I'm ready for the last step, I think. I've got my URLs looking like this. /brochure.php?cat_path=35&name=concrete-intermediate-posts This is great and finally I just need to know how to turn that URL into this desired URL: /brochure/35/concrete-intermediate-posts Just like t...

Remove store code from URL in Magento

I have 2 sites on one Magento install that point to different domains. Site1 => www.site1.com Site2 => www.site2.com Each site shows the store code in the url of category, product, and CMS pages (www.site1.com/store1/category). Is there a way to remove the /store1/ from the url so that is just www.site1.com/category? My guess is that ...

Apache URL Rewrite to domain.com/custom_url_name

Using Apache on a Red Hat server, I'm trying to rewrite the URL of a member's store on our website from: domain.com/store.php?url=12345 to: domain.com/12345 Using these rules, I can get it to work if I always remember to add an ending slash: Options -Indexes Options +FollowSymLinks RewriteEngine on RewriteRule ^store/url/(.*)$ st...

Why is this RewriteRule broken?

Ok folks, I'm at a loss. RewriteCond %{HTTP_HOST} ^domain.nl$ RewriteRule ^(.*)$ poker/$1 [L] Throws me a 500 error. If I remove the redirect and go to /poker/ manually it works. If I use this: RewriteCond %{HTTP_HOST} ^domain.nl$ RewriteRule ^$ poker/ [L] The front page is shown (but the css not, because obviously anything after t...

Problem with .htaccess and RewriteRule

I have url's like games/xbox/2 2 being the page number I need the url rewritten. This is what I'm using: RewriteRule games/(.*?)/$ games/consoles.php?console=$1 RewriteRule games/(.+?)/(.+?)/$ games/consoles.php?console=$1&page=$2 The first rule works fine but the second is returning consoles.php as $1 instead of xbox ...

problem with .htaccess rewrite rule

I have url's like games/xbox/2 2 being the page number. some url's are as follows games/xbox-360/2 i need the links to be rewritten. here is the code i am using which works fine for the links with no - in them RewriteRule games/([A-Za-z0-9]+)/?$ games/consoles.php?console=$1 RewriteRule games/([A-Za-z0-9]+)/([0-9]+)/?$ games/consoles.p...

remove query string from url through mod rewrite.

Hi all, I am very new to mod rewrite so any help would be apprecited. let say i have a site named "www.sitename.com/index.php?p=contact" and i need to remove "index.php?p=" so that it will look like "www.sitename/contact" at its every occurence that means either i should be able to truncate "index.php?p=" or i should be able to replac...

CodeIgniter: Multiple Apps, remove .php from url

Hello everyone. My question may look similar to others, but it's different as you'll se: I have 5 CI apps running with the same System Folder, as described in CI User Guide. Now, I want some .htacces file to remove just the .php from the url, like, as example: http://example.com/appName/controller/action instead of http://example.com/a...

Help Converting Apache htaccess to Nginx Rewrite rules

I need to convertthe following Apache htaccess rules to Nginx Rewrite rules: Redirect 301 /feed.php http://www.example.com/feed/ Thanks very much~ ...

htaccess rewriting all requests to a single controller

In a similar way to codeigniter I want to catch all requests and rewrite them to an index.php file which sites in the root of my web accessible folder. Unlike the examples on codeigniter however I do not want to check whether the file exists before I rewrite it (because I dont want to allow direct access to any files). I have had partia...

Using .htaccess to Deny Access to a folder & Unlock the folder when authorised user is encountered

I have a CMS kept at seperately folder in my Website, lets name it public_html\cms for now. I want this folder initially locked using .htaccess and later on when a moderator comes, he must be able to login and gain access to the folder CMS. How do build this? ...

Tricky .htaccess and Drupal problem

1) I have a Drupal site located at http://example.com and I have a directory located at http://example.com/foo, but I also have a Drupal page with an alias of http://example.com/foo. How can I get the Drupal page to serve? Currently, I get a 403 forbidden page as a result of the Options -Indexes declaration in Drupal's .htaccess file, bu...

want 301 redirects to all except robots.txt

Hi all, we have moved our website to new domain & want all pages of old site to get removed from search engines. Its the same site, same content, just a new domain, so search-engines are taking time because of duplicate content (maybe). We have added .htaccess 301 from our old site to new site as: redirect 301 / http://new-domain.com/ N...

Is it possible to associate /upload/picture to /upload.php?what=picture with htaccess?

Is it possible to associate /upload/picture to /upload.php?what=picture with htaccess and when I submit a form to /upload/picture it is taken by the upload.php? If it is, how? ...

Why won't this mod_rewrite rule work (via .htaccess one specific url to another)

RewriteRule ^/tag/term$ /tag/term-expanded-here [R] ...

How can I force https for *.example.com?

How can I force https for *.example.com? I have tried: RewriteCond %{HTTPS} !=on RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L] ...

URL with trailing slash breaks layout - how can I fix this without using base tag?

I am developing a website, and I have set up the following htaccess rules RewriteEngine On #RewriteRule ^([0-9]+)?$ index.php?page=$1 #RewriteRule ^([0-9]+)/([0-9]+)?$ index.php?page=$1&post=$2 RewriteRule ^([A-Za-z0-9-]+)?$ index.php?pagename=$1 RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$ index.php?pagename=$1&post=$2 This ensures...

Adding mod-rewrite to an existing PHP website

I am updating a php app, which currently does not use url rewriting. The aim is to hide file extensions. The general structure of the website is as follows root/ index.php login.php page1.php page2.php page3.php page4.php page5.php page6.php page7.php page8.php subfolder/ index.php validpage.php images/ css/ Th...