I have this snippet
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|img|css|js|robots\.txt)
RewriteRule (.*) index.php?/$1 [L]
It won't allow me to access a file at website.com/js/main.php
but it will let me access index.php
According to my webhost, $1 is...
i have a domain with a website in a folder.
i.e
http://domain.com.au/website/page.php
i only have access to .htaccess files to make the rules.
i would like my url to look like this..
http://domain.com.au/page
so in essence i want to drop the subfolder its sitting in, and the php extention.
All links in my php are structured like thi...
I have the following .htaccess file in a directory:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://www.mysite.com/launch [R,L]
DirectoryIndex index.html
Basically, this forces any and all pages below mysite.com/launch to an SSL version of https://www.mysite.com/launch/index.html.
However, for a single sub-dire...
How do I rewrite this rule to redirect everything back to the index or server_root?
If there is a request for say, www.site.com/articles/some-article.php, the somearticle.php should be re-routed back to the index page. I also don't want to have the url showing the "index" portion of the URL. site.com/index is where everything should be ...
I've got a duplicate content issue where there's two instances of my site indexed in google:
the first is the actual domain: http://domain.com
the seconds is my WHM/CPanel preview of the account: http://123.456.78.9/~/domain
Is there any way to redirect the IP version to the real domain?
...
A site has an existing system (lets call it mysite)
and the client asks to put in magento.
My directory structure goes something like this:
ROOT
-index.php (this is the app's main controller)
-.htaccess
/blog (runs wordpress)
/assets (current system's media folder)
/magento (this is where all magento files go)
P...
Hi,
I want to write a .htaccess from which the following action should be done.
I have domain like
www.xyz.com
and am putting many articles on that.
so it wil become
www.xyz.com/article1-tutorial/
www.xyz.com/article2-tutorial/
www.xyz.com/article3-tutorial/
But instead of that i need like this.
www.article1-tutorial.xyz.com...
I am using a wildcard dns system that routes all subdomains through a single web app and sets a userid based on the first part of the URL (X.domain.com where X is the username).
I now want to edit my htaccess file to enable conditional httpauth using htpasswd for specific domains. e.g. if url = password.domain.com the enable httpauth.
...
I have a very simple .htaccess file set up to redirect a 404 to a php script:
ErrorDocument 404 /404.php
This works as expected in Safari, but does not work in Google Chrome (on a Mac or a PC).
I have also put a 404.htm file to see if the php script was the problem, but had the same results.
Why would Chrome have a different experie...
I am trying to redirect my whole site to non-www
here is the htaccess code I am using
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# no www
RewriteEngine On
RewriteCond %{HTTP_HO...
Hello,
I recently found an article online that told me about this:
RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1§ion=$2 [NC]
Only thing that is driving me crazy right now is if I want to be able to have the 2nd directory or not. Like:
RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1§ion=$2 [...
Pulling my hair out over this one.
I have one wordpress install at /2009 and one at /2010. I am trying to redirect all requests to the 2009 site to the 2010 site. I have tried both of these in the root .htaccess and in the /2009 .htaccess:
RewriteRule ^2009.*$ 2010 [R=301,L]
RewriteCond %{REQUEST_URI} ^2009.*$
RewriteRule . 2010 [R=3...
Let's say you have the following setup.
You have a server with the basepath set to the normal webroot.
The server has files in the following structure
/projects
/some-unique-id
/index.html
/images
/some-unique-id
/index.html
/images
Is it possible to have a .htaccess file somehow redirect the...
I have two domains ("this_site.com" and "that_site.com") that I want to point to the same place (same set of files).
BUT
What I really want to do is maintain the original URL in the address bar while the visitor accesses the different pages.
Example: The primary domain holding the web files is "this_site.com". If I type in "that_site....
Hi,
i tried to use wordpress and codeigniter for a intelligent join between the best CMS and the best PHP Framework. Actually i intended to use codeigniter for database managemnent and wordpress for display. But i wanted to use codeigniter inside wordpress. So, i have a file tree like that:
www
- codigniter-core folder
- .htaccess
- ...
Okay, so I have a website where the user can put a search query into a form that uses GET to send the data.
When it gets sent, the url looks like: /recipes.php?query=taco&ingredients=chili
And I would like to rewrite it to look like: /recipes-taco-Ichili.html
So I added the following line to my .htaccess file:
RewriteRule recipes\.php...
I need a rewriterule so if i type index.html i will show index.php
I mean i have files like, home.php, about.php and i want to be able to access them with .html too
Thanks in advance
...
Hi,
I've implemented a simple .htaccess to rewrite any request on a particular directory.
It works to an extent. If you request with nothing after the trailing slash, then it redirects fine. If you put anything after the trailing slash, it is appended to the end of the URL you're trying to re-direct to.
For example,
You request: /...
The following .htaccess file does not work:
SSLrequireSSL
RewriteEngine on
RewriteCond %{HTTP_HOST} !^secure\.neuralfutures\.com [NC]
RewriteRule (.*) - [F]
I'm trying to prevent access to anything but "https://secure.neuralfutures.com/docs/", i.e. "https://www.neuralfutures.com/docs/" will fail.
I also seem to be running into cachi...
I'm setting up some simple url rewriting rules using mod_rewrite and a .htacces file, but I've got some problems.
If I set up the .htacces this way:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule /index.html /index.php [L]
when I call from the browser this url:
http://localhost/~dave/mySite/index.html
I got a 404...