I have two domains in the format of foo.com and foo.net. I currently have the following in my .htaccess to redirect non-www to www:
# Rewrite URL to force WWW
RewriteCond %{HTTP_HOST} ^[^.]*\.[^.]*$
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^[^.]*\.[^...
I'm trying to upload files into a folder, but it keeps failing and I think CakePHP is taking over the write and try to process it as a Controller.
Is this true? And if so, how can I sidestep it?
...
Hey, I've been reading StackOverflow.com for a long time but decided to sign up to ask a question. I'm writing my own lightweight MVC framework that routes page requests in index.php.
Page requests look like /controller/action/arg1/arg2/arg3, and they should be rewritten to index.php?route=[request]. So, a [request] like site.com/user/p...
I'm having a small problem with my htaccess files. Currently, it redirects everything back to index.php for processing, except when someone tries to access an actual directory. When the directory exists, it displays the 403 error page instead of rewriting the path to index.php like it's supposed too. What can I modify to make it always g...
There's a couple other questions on this same topic on here that I've read, but mine is slightly different. I'm trying to do a very basic mod_rewrite:
RewriteEngine on
RewriteRule ^go/([^/\.]+)/?$ /go.php?page=$1
go.php looks like this:
<?php
ini_set('display_errors',1);
if(isset($_GET['page'])){
echo 'page='.$_GET['page'];
}els...
Hi! To rewrite example.com to www.example.com I was told to use the following rules within my root .htaccess file:
# Require the www
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteCond %{REQUEST_URI} !^/sitemap\.xml$
RewriteCond %{REQUEST_URI} !^/favicon\.ico$
Re...
For some reason, we recieving a bunch of inbound traffic on URLs that contain HTML entities.
E.g.
http://www.ourdomain.com/index.php?key1=value1&amp;key2=value2
I want to create a RewriteRule to replace these HTML entities (specifically & with &), and forward people on to the corrected address.
I'm tried these:
RewriteRule &...
I need a .htaccess file:
the file will rewrite rule for:
xyz.sitename.com
will be rewritten as:
sitename.com/index.php/a/b/xyz
xyz.sitename.com/m/n/o
will be rewritten as:
sitename.com/index.php/m/n/o/xyz
sitename.com/m/n/o
will be rewritten as:
sitename.com/index.php/m/n/o
...
I want an htaccess rewrite rule to grab everything past the host name and use it as an argument. For example, I want http://example.com/one to be handled by http://example.com/category.php?cat=one
I think it should be simple, but I can't quite find the combination.
Thanks
...
I want to re-write url using .htaccess I am new to it have created a site which is multi language.
I want my url and all directories or files under it to have a lang=en variable in it while url looks like.
site.com/en/
should be presenting http://site.com/?lang=en
or site.com/en/test1/?test=1
should be like: site.com/test1/?test...
RewriteEngine On
RewriteRule ^/ai?$ /Market/publish.jsp [QSA,L,PT]
RewriteRule ^/ar?$ /Market/MailDispatch [QSA,L,PT]
RewriteCond %{HTTP_HOST} !^web\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://web.example.com/$1 [L,R]
#How skip www\. to web\. for this 1 ?
#RewriteRule ^/vi/?([0-9]+)\.htm$ /Marke...
If there is browse_by_exam or my_study_centre in the 1st position starting from project_name as in
http://project_name/browse_by_exam/type/classes/...
http://project_name/my_study_centre/page_sort/1,20,name,asc/...
Then apply these 2 rules:-
RewriteRule ^([a-zA-Z0-9\-\_]+)/?$ index.php?a=$1
RewriteRule ^([a-z0-9\-\_]+)/([a-z0-9\-\_]...
I am not sure who the culprit is, but here's the apache error log using LogLevel Debug:
[Tue Jul 13 11:51:18 2010] [debug] core.c(3069): [client 68.178.109.243] redirected from r->uri = /index.php/favicon.ico/favicon.ico/favicon.ico/favicon.ico/favicon.ico/favicon.ico/favicon.ico/favicon.ico
[Tue Jul 13 11:51:18 2010] [debug] core.c(30...
I'd like to redirect all top level directories to a file using mod_rewrite.
So the following should redirect there:
- http://example.com/test
- http://example.com/test8/
- http://example.com/test_9231/
The following should NOT redirect there:
- http://example.com/test.php
- http://example.com/test_9231/test/
- http://example.com/t...
Hello,
I started finally to understand Apache mod_rewrite. It's pretty GREAT!
Plz have a look at the followings:
1) Permanent redirects "http://www.domain.com/folder_name/" (with or without final slash and with or without the 'www') to "http://www.domain.com/some/path/some_page.html"
RewriteRule ^folder_name[/]*$ "http\:\/\/domain\...
Hello,
i have a url like this http://example.com/blog/photos/photos/gallery/image/1.
And i need to remove the second photos folder. How do i remove the part using mod_rewrite and .htaccess?
For your interest /blog is my document root.
Thanks a lot for any suggestions, Steve
EDIT
You should know that the URLs being generated by Word...
Situation (directories tree) on an Apache server:
maindomain.com/
|
|_ .htaccess (just an empty file, no rule in here)
|
|_ addondomain1.com/
| |
| |_ .htaccess
| |_ index.html
|
|_ addondomain2.com/
|
|_ .htaccess
|_ index.html
Currently files in addondomain1.com can be viewed by going to:
http://www.addondomain1.com/ind...
I've been using mod_rewrite in my htaccess file to rewrite my urls and I've run into a problem when doing pagination.
Here's the url for my page:
http://domain.com/concerts/features/folk-roots?page=2
htaccess file:
RewriteRule ^features/([^/]*)?page=([0-9]*)$ featureCat.php?cat=$1&page=$2 [NC,L]
It works fine without the page query,...
Hi, I want to redirect every archive pages on my blog to new directories
but I don't know how to mod rewrite in htaccess file.
It might not be possible to do this because I added extra date variable in the new url?
OLD URL
http://www.url.com/blog/2010/03/blog-entry.html
NEW URL
http://www.url.com/blog/2010-03-05/blog-entry/
...
Possible Duplicate:
Passing varible types though mod-rewrite
howdy,
I'm using the get method on my current project.
my links refer to <a href='?p=". $path … and i'm getting there values with if(isset($_GET['p'])) …
everytime i click a link the url in the adressbar changes to mydomain.com/?p=files/path/subpath
i wonder if i ...