.htaccess

Issue with redirection of a folder with mod_alias

Another question following on from this thread. The only remaining item that I can't solve is that there is a listing for an now non-existent folder '/team/', but if I add this into my .htaccess file, it breaks all other .htaccess entries for files in that folder, i.e. redirect 301 /team/ /team.html redirect 301 /team/joe_bloggs.htm /t...

Mod Rewrite - How to point main site to subfolder

Hello I've domain using wildcard dns but I want my main site example.com will grab content from folder /home/ by example. If user type http://www.example.com/ or http://example.com/ site will read file from subfolder /public_html/home/ If http://subdomain.example.com/ will reading content from /public_html/. Let me know how to that ...

Simple Youtube + Htaccess Redirection

website.com/yt/MGEPkLPGB6E would forward to youtube.com/watch?v=MGEPkLPGB6E ...

return 404 error on existing directory

Ok so i have a directory in my root folder called /pages in which i keep all my pages that i include thru index.php What I wonder is would could i somehow return a 404 error if someone requests it? i dont like snoopy people... ...

.htaccess - RewriteCond problems

Hi guys, There is a problem with my .htaccess file. If I type in "website.com" it redirects me correctly to "www.website.com", but if I type in "website.com/level1/level2" it redirects me to "www.website.com/index.php/level2" and gives me a 404 error. Here is what I have in my .htacces file: Options +FollowSymLinks IndexIgnore */* Re...

.htaccess subdomain and /

username.domain.com/file rewrite to domain.com/q.php?user=username&url=file how do that? Thanks. Sorry for my English. ...

Least resource-intensive way to set up 4 'pretty' URLs?

I'm planning an API for my own use, in Python. Perhaps someday I will make it freely accessible, but now I'm only planning to use it on my hobby site. At this stage I need some advice on how to set up the URLs, for files that receive both GET and POST requests. Suppose one of my files is called function_A.py and used in this fashion: w...

Alternative to mod_expires for setting expiration headers?

I am using php on an Apache server. I am unable to set expiration headers in .htaccess on the server that I am working on, as it is a shared server and they (the web host) will not install the mod_expires module in the apache build. I have always used the "ExpiresActive On" and set the default cache expiration for images, js, xml and tex...

how do I create the following .htaccess file

I have written the following code in my .htaccess file Options +FollowSymLinks RewriteEngine on RewriteRule page/(.*)/ index.php?page=$1&%{QUERY_STRING} RewriteRule page/(.*) index.php?page=$1&%{QUERY_STRING} The url "xyz.in/index.php?page=home" will look like this in the address bar of browser "xyz.in/page/home" If I want to pass a ...

htaccess for www-only redirection

hi guys! Is there any way I can redirect my urls to only use http://www.domain.com instead of http://domain.com? Here's my htaccess but doesnt work: # Turn on URL rewriting RewriteEngine On # Installation directory # RewriteBase /test/ Options +FollowSymlinks # Protect application and system files from being viewed RewriteRule ^(app...

.htaccess redirect problem

i have following of 404 page.... RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.+)$ ?file=$1 [L] but it is showing this page to all directories and page event the root directory ...

mod_rewrite: how to point to a different file but keep the query vars ?

I have these rewriteRules which work fine: # 4 params RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?app=$1&do=$2&what=$3&id=$4 [NC,L,QSA] # 3 params RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ index.php?app=$1&do=$2&what=$3 [NC,L,QSA] # 2 params RewriteRule ^([A-Za-z0-9-]...

.htaccess to Redirect All Traffic to One Page (410 Gone)

We have a client that is closing its doors. We want to redirect all traffic that goes to their domain to a new page index.html with a few images in the _img subdirectory. (The page explains what happened, what current customers can expect with their current orders, etc.) I've read about possibly using HTTP 410 Gone as the best way to te...

PHP: .htaccess 301 redirect not working

I have a basic CMS in PHP/MySQL where content managers can create pages to the system for public viewing. Each page is then available at an url such as http://www.example.com/pages.php?pid=123 Now, I want to redirect requests to http://www.example.com/pages.php?pid=123 to http://www.example.com/pages.php?pid=456. I've already removed th...

301 redirect in codeigniter

ok, so i can't tell if this is a server issue or what. i've got an htaccess file like so: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/main/index/$1 [L] RewriteRule ^ajax/(.*...

.htaccess mod rewrite automatically using php or something?

I've got a number of users, each with the website page like http://www.mysite.com/folder/artist%5Fid.php?id=33 The users need to be able to set their own easy URL such as http://www.mysite.com/userguy that would redirect to the above page. I know how to write these out manually in .htaccess with RewriteRule but, for example, users have...

Redirect 301 & Mod Rewrite Issues

I have a online store that, for example, is located here: hxxp://domain.com/store/ Within the store directory's .htaccess file I have this: Options +FollowSymlinks RewriteEngine on RewriteBase /store/ RewriteCond %{HTTP_HOST} !^www.domain.com$ RewriteRule ^(.*)$ http://www.domain.com/store/$1 [R=301] RewriteRule ^/?$ directory.php Rewr...

htaccess redirect question

If no language parameter is present in the url of my site, I'd like to force a redirect to the English version of the site. My urls are as such: http://localhost:8888/site_name/products http://localhost:8888/site_name/products/a-nice-product etc If there is no "en", "fr" or "nl" after /site_name/ id like htaccess to redirect it to wha...

URL rewrite issues using .htaccess

I'm trying to write a URL like below, but when I try to call the seo queryparam, it always returns index.php. Any idea why it isn't returning the correct value for 'seo'? RewriteRule ^([^/]*)$ index.php?c=home&m=details&seo=$1 [L] The URL it should forward from would be something like this: http://domain.com/The-Name-of-the-Product. ...

URL rewriting - removing hash

How can I remove the hash sign (#) from the page's URL ? I am using the SWFAddress plugin (jQuery) for deep linking purposes. I need to replace this localhost/site/#blog by localhost/site/blog (Yes, #blog is just an anchor). Somehow url rewriting in .htaccess doesn't work RewriteRule /blog #blog [L] Any suggestions ? ...