I'm getting started with making few redirect with .htaccess but I just made something wrong.
I was trying to make a redirect where when I write http://www.mydomain.com/it/about the browser jump to http://www.mydomain.com/it/about.php but I wrote something wrong!
I can't remember exacly what I wrote (I took some code over the Internet several times) but the problem now is that I've deleted the .htaccess but when I try to access to http://www.mydomain.com/it/about.php the browser is redirected to http://www.mydomain.com/it/about.
How can this happen???? There is not any .htaccess into the server!!!!!!
If you use a 301-Redirect ([R=301]), the Browser will cache the redirect. Try an other browser or delete your cache
Are you sure it's gone? .htaccess files are hidden for security.
Try uploading an empty .htaccess file.
disable the rewrite module by typing "a2dismod rewrite" in terminal and re enable it. this will remove effects of .htaccess file.
Related
I need to redirect all calls to aspx files in a specific sub-folder of the web to the same name and path with a .php extension.
For example
/onlinehelp/default.aspx will go to /onlinehelp/default.php
/onlinehelp/stuff/junk.aspx will go to /onlinehelp/stuff/junk.php
It seems simple enough, but I can't get it to work. I thought this would work:
RedirectMatch 301 (/onlinehelp/.*)\.aspx$ http://www.mydomanin.com$1.php
What am I missing?
thank you...it is working ....now. must have been a caching problem. curse the load balancers!!! lol sorry for the trouble. I appreciate the responses
The .htaccess file is sitting in the subfolder /onlinhelp/ where I need the redirection to take place.
I've been trying to get a website up an running on my work's servers using Verio windows server 2003 gold and they've been quite useless when it comes to helping me out.
All I'm trying to do is set up a Wordpress installation, which they apparently require to be in a subdirectory. This is done and I have it in domain.com/wp ready to go. At this point they recommend that I use an .htaccess file to redirect to that url, so as they just sent me basically an "About .htaccess" link, that was of no help.
Did some searching, found a couple options like this one:
http://www.site5.com/blog/apache/htaccess/redirect-to-blog/20090427/
and nothing I use seems to work, not even as a straight redirect. Just gives me a "Directory Listing Denied - This Virtual Directory does not allow contents to be listed."
I do want to mention I did enable URL Rewrite for IIS via ISAPI_Rewrite 3 in the control panel.
As I mentioned Verio support is useless and I can't seem to find anything searching that seems to help my situation.
So pretty much what I need is domain.com/wp to rewrite as domain.com so all links centered around it do the same (ie domain.com/about domain.com/contact)
Any help? Thanks
If I understand you correct you need your Wordpress application to be available from the root of your web site instead of /wp/ folder? Then please try following .htaccess:
RewriteEngine on
RewriteRule ^(?!wp/)(.*) /wp/$1 [NC]
By the way I think you could try simply copying /wp/ folder content to the root folder.
So here's the thing .. I've been working on my webpage for some time now. I have a .htaccess in the root folder that contains only a few rows of rewriting rules and nothing else. It works fine on localhost but when I upload it to my host it just throws 404 error (my host is 000webhost.com). I tried eliminating every rule one by one to see where the error is, but nothing happened, I even deleted the contents of the .htaccess file and still it gives a 404 error. The only solution that worked (so far) was deleting the .htaccess file and only then the homepage appears. Any suggestions?
I just found out that my host doesn't support UTF8 encoding (i guess?) in .htaccess file so i changed the encoding to ANSI and it did the trick.
Have you tried the suggestion on your web host's site:
http://www.000webhost.com/faq.php?ID=16
they are suggesting you put this at the top of your .htaccess
RewriteBase /
I've just had a problem from last few hours. For a client I needed to redirect some urls to other specific urls through his .htaccess files. I just went through his ftp from Filezilla as he has cloud hosting, there wasn't any cpanel. I just had a .htaccess file which contains only 301 redirects, I uploaded it into /content folder.. Then I opened the site and saw it dead, before it it was working fine. Now whenever I open the site I receive this
Upgrade in progress.
Copy changes to updated version(complete 4:45)
Copy settings to updated version(complete 5:00)
Back up whole site.(complete 6:44)
Back up the database(complete 6:45)
Upgrade database(complete 6:49)
Upload new code
If I try to go to /index.php I receive this.
phpPennyAuction
phpPennyAuction is not yet completely installed.
Please check the following:
That both of your .htaccess files are present and correct.
That your server has mod_rewrite installed
That your server is configured with AllowOverride set to All
If you need further assistance, please contact phpPennyAuction Support.
All contents © 2010 Scriptmatix Ltd. phpPennyAuction
Before just putting .htaccess file everything was fine. I just removed my .htaccess file, renamed the cache folder still the same problem. I might pay a little cup of coffee to anyone who helps fixing in this.
P.S Don't advise to ask on their forum, just contact their support the guy unofficially said "I'm not sure what's the problem I will charge 300 USD".
It is a big trouble for me, help appreciated.
Thanks
Kazim
I think that when you uploaded the htaccess file you overwrote the htaccess file used by phpPennyAuction.
Try to find the original htaccess file(s) and put them back. They should be in the original "installer" or download.
After that you could put the content of your 301 file a the top of the htaccess.
You need the .htaccess file that is provided in the folder:
install-data/packages/01/phppa.zip/.htaccess
I'm writing a .htaccess to support a couple moved files on a site. The concept is that /filename.htm is now at /filename/index.htm and I want links to it to read just /filename/. Here is what I have:
redirect permanent /filename.htm http://www.example.com/filename/
Will this work as expected? Thanks.
Yes, your code looks good, should do the trick.