http://localhost/projectname/
The above url works fine .
But if we input
http://localhost/PROJECTNAME/
it gives a "404 Page Not Found" error.
I just want to know how to convert Uppercase PROJECTNAME to Lowercase projectname.
I am using php 5.4 along with IIS 8.5.
And I also want to get rid of index.php.
I need some help with the rewrite rule or routing or maping.
Any help will be appreciated. Thanks.
You have to do it by htacces only,
Best way is don't use localhost use virtual host
Use the ip directly ,you can get a bind pannel there you can set ip
Related
I have a cakephp 3 script installed on my cpanel account.
this domain is the primary domain for account but i have relocated it to a subfolder for necessary reasons.
my htaccess rewrites it perfectly and every url works both with and without /subfolder/ in the url.
However, all the links in cakephp automatically append /subfolder/ back into the url.
I even tried manually replacing $base_url in configuration.php with 'mydomain.com'; only, but that didn't work. Then I replaced every instance in all the hundreds of files of $base_url with 'mydomain.com'; but still, nothing changed and it still shows that /subfolder/ in every url even when i access mydomain.com directly._
I need to get rid of this /subfolder/ in the url that cakephp is serving from php. i tried everything i knew but nothing works.
Please tell me how to solve this problem.
Have you tried setting App.base, App.webroot? Setting those values up will disable automatic directory detection and should help you get the URLs you want. See configuration docs for more on those values.
Is it possible in any way to remove index.php in url without using .htaccess
if yes then how.
and if not then how to make htaccess file in xampp server.
how to apply this in live server.
i tried to make through class but i think it is not possible but i want to be sure so please help me on this ...
what i find is something like
$route['(:any)'] = 'index.php/$1';
in htccess every where so i believe it is not possible because it is something doing nothing with php or any language it is server thing and only chance or way we have is htaccess
I am trying to create a new domain which runs on SilverStripe 3.0. I am unable to figure out the issue. If I upload a custom php page then it runs fine, but my website is not working. It shows blank page but shows the favico.
If I try to open up www.mydomain.com/admin/, I get the error
Page Not Found
The requested URL /admin/pages was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This is not a Silverstripe error page. Here is my php info Info
Please let me know if I am missing something or there is any way to figure out the issue.
Try www.yourdomain.com/index.php/admin
If that works then it is because your rewrites are not working. This can be because .htaccess isn't configured properly, or because .htaccess is not used at all (in which case you need to edit your server config).
Last I used Plesk it always used apache. If that is different now and you're using nginx as more than a forward proxy, then you will need to set up the redirects for your site manually.
It does sound like your .htaccess is not being respected. Does Plesk allow overrides for .htaccess in the local directory?
At an apache level we would have something like this stanza to ensure the the .htaccess of the project was respected;
AllowOverride All
If your .htaccess is being processed, make sure that your host has mod_rewrite enabled as that is required to access to pretty URLS.
Suppose i have a link generated in php:
http://localhost/Example/www.someDomain.com
now i would like to go to www.someDomain.com , can you please help me with the proper method (probably via .htaccess) to redirect to desired location.
I tried using php header function and js window.location.replace(" ") but it dint' helped.
***Problem with window.location.replace("www.someDomain.com") is that instead of redirectng to www.someDomain.com , the page redirects to http://localhost/www.someDomain.com
I am using Wamp server if it helps.
Help please and also suggest some nice resource to study about .htaccess
Thanks
If I understood.
you need to put te entire URL with "http://".
Javascript:
<script>
window.location.href=("URL");
</script>
OR in php:
<?php
header("location:$redirect");
?>
You can use window.location or PHP header() function, but for redirect to another site must prefix with http://.
header("Location: http://www.example.com");
You can also do the same through Apache .htaccess with a Redirect rule.
htaccess is NOT going to help you at all. If all your links look like: http://localhost/... then in order for htaccess to redirect, everyone who goes to your site would have to be running a webserver on their local machine and have an htaccess file that redirects to your site.
You need to fix your php scripts so they generate the correct hostname. Using javascript to redirect isn't even a viable solution, because in order for the location to be "localhost", they're already loading no content because they're trying to connect to their own machine.
If for whatever crazy reason you can't fix your scripts, you may have to look into using mod_proxy_html on your site and dynamically change all your "localhost" to your domain.
I installed OpenScholar in my domain:
http://scholar.web
Basically, when someone register for an account, his site URL is http://scholar.web/user, and his content will be at http://scholar.web/user/contents
I've been searching a way so that the URL is converted into: http://user.scholar.web/content for displaying his content via virtual subdomain (htaccess maybe)
Anyone can provide some solutions or guidance?
thanks
First of all, you'll need to change the DNS entry on the domain so that *.scholar.web points to your site.
Afterwards, (If you're using Apache) change the Apache vhost to accept *.scholar.web requests.
You can then use htaccess and/or PHP to do what you like with the URL formatting.
I used to have a domain called something along the lines of "iscool.com".
This is the method I used so I could use pseudo subdomains like "ben.iscool.com" and it would display content accordingly.