a simple question. I've a file named xyz.php on the domain http://mybeautifulsite.com. Url is http://mybeautifulsite.com/xyz.php
When i type http://mybeautifulsite.com/xyz.php all is right good.
But if i type without php : http://mybeautifulsite.com/xyz I've a 404 error
What onfiguration is missing ?
Thank you
This is because of the way webservers work. without the .php the internet browser is assuming that xyz is a folder with an index.html. So its interpreting it as
http://mybeautifulsite.com/xyz/index.html
Related
I've registered my friends website and created it from names.co.uk, the website is (http://www.boillixbaits.co.uk)
I have followed their instructions from their support page as this is my first time trying to create an error page (http://www.names.co.uk/support/hosting/support_centre/linux_hosting/1255-how_to_add_custom_404_error_pages.html)
I followed every step exactly but for some reason this didn't work? Has anyone got any friendly advice or better still what I need to do to make an error-page work when the wrong address is typed in?
Many thanks in advance :)
What you want to do is go to the root of your site (the "public_html" folder, or the "www" folder, in your FTP program. Then you want to make a file called ".htaccess". Not "something.htaccess" or "custom.htaccess", just ".htaccess". In that file, you want to put:
ErrorDocument 404 /404.html
the "/404.html" should be an absolute path to your 404 file. So if your 404 file was in "public_html/files/custom404.html", you would put "/files/custom404.html"
I was wondering if somebody could guide me to configure my web server to do the following:
http://mywebsite.com/default.asp/PATH
Where Path would be retreive into a var.
My problem is the following:
When I call : http://mywebsite.com/default.asp/PATH
I get a 404 error, probably because IIS thinks that default.asp is a directory?
Anyway, any help would be greatly appreciated!
default.asp is a file. Files are always leaf objects in paths, so you can't have what you're asking for. What you can have is:
http://example.com/PATH/default.asp
or
http://example.com/default.asp?PATH
In the latter, PATH is a parameter passed to the ASP page default.asp.
I have just been asked to migrate a site from one server to another for a site that I did not build. They have a lot of links to pages that dont exist.
<a href="app/batteries">
This is not actually a directory in the site, but there is an app.php file in the root directory. I have gotten it to display the products by redirecting anything to the app/ directory to app.php?app=. The value of ?app= is dynamic, so any solution would need to be dynamic. I have simply used the redirect statement in the htaccess file to get it to the app.php page. Is there a way to get the url back to the pretty url after a redirect?
Any help would be awesome. Thanks in advance.
You should use ModRewrite instead, for matching a pretty url with regexps, and converting into the url using the app.php.
The rewrite is local to the server, so the visitor sees only pretty urls.
I am trying to build mu first web application with yii
From what I understood a .htaccess file must be in the project folder
in the localhost every things work fine, but when I upload the whole project my remote server doesn't accept .htaccess files and I get 404 not found (server error not yii error)
there is an alternative to this problem ?
many thanks in advance
There is no alternative when using a Front Controller pattern. Only on the http server you can redirect all wanted requests to a single central point. It is weird though that you cannot use .htaccess.
One more question: are you using apache or something else as a web server? Because .htaccess is apache specific to the best of my knowledge, for other servers you need differend configuration in differend other places.
Hopefully a simple question although one I have found impossible to answer myself using the Googles!
I have a website on IIS with the URL http://www.contoso.com/ which points to C:\www\public\
There has been a forced directory restructure so now all of the data (Default.aspx, Product.aspx, etc.) that originally resided in C:\www\public\ now resides in C:\www\public\en\ie\ - however, the IIS website document root is still C:\www\public\
So, essentially, I have a lot of inbound links to http://www.contoso.com/Product.aspx?id=1 (etc.) which are now returning 404 errors - the correct link is now http://www.contoso.com/en/ie/Product.aspx?id=1
Please consider that I can make no changes to the directory structure or the IIS document root... so I must solve this issue using URL rewriting.
Is it possible to capture all requests to contoso.com/* and rewrite them to contoso.com/en/ie/* ??
As Ivo suggests, using url rewriting you can set up inbound rules that match the old url pattern and redirect to the new pattern
http://learn.iis.net/page.aspx/460/using-url-rewrite-module/
Change the root directory of your website from C:\www\public\ to C:\www\public\en\ie\ and everything should be fine.
If you cannot do this for any reason, make a custom 404 page and rewrite to url in there and redirect with a 301
See: http://searchengineland.com/url-rewriting-custom-error-pages-in-aspnet-20-12234