How to Redirect urls after index.php in Laravel - laravel

We have a classified website developed in Laravel Framework. After analyzing the url structure I am getting the following issue:
Original Url: https://in.mysite.com/female-clothes/mycity
Duplicate Url: https://in.mysite.com/index.php/female-clothes/mycity
Every url is being duplicated as per the example given above.
Please let me know how to fix the above issue.
I think best option would be to 301 redirect Duplicate url to the Original url.
Please let me know the htaccess rule to fix the issue.

Do you know which version of laravel?
From what you've said this could be happening in the server (htaccess) or the application (laravel).
Laravel is able to handle url manipulation and redirection. The routing logic is usually found on the file called web.php (router.php for older version). It seems that the string 'index.php' is being inserted in the middle of your urls so look for it there.
If it's not happening in Laravel it could be in the htaccess, so look there as well.

Related

Laravel with URL issues

I need help with Laravel.
My website has multiple URLs for the same pages. The URL includes category-subcategory-product but the URL include: double slash category//product or category//subcategory/product and all they link to the same page.
I asked a developer he said not sure but it maybe from route issue-URL not setup correctly.
Has anyone come across with such issue? What's the main problem and how can I fix it quickly?

TYPO3 HTTPS://www. redirects to Page Not Found

Hope that someone can help me solve this strange https:// behaviour in TYPO3 8.7.2 (and 7.6)
All https:// referrers are working fine. The only one giving a problem is the https://www.hocom-advies.nl which produces an url like this:
https://www.hocom-advies.nl/hocom-advies.nl which results in a TYPO3 error: Page not found! ??
I have all rewriting in my Vhost. Only some basic TYPO3 rewrite stuff in the .htaccess file. And some basic TS lines in the config.
The same https request on an other TYPO3 8.7.2 system is working ok! Both settings in the VHost and TSconfig are equal.
So where to look for here? Any idea? Thanks.
your domain duplication can have multiple reasons:
have you configured config.absRefPrefix = / (or have you inserted your domain?)
don't use baseURL!
are your rewrites clean? (no missing protocols?)
do you generate links without protocol?

mod_rewrite subdomain in Symfony2

Please help with mod_rewrite subdomain to some Symfony2 routing. It is like 3 months now I spent time to solve this with my Symfony2 project but after reading tons of apache mod_rewrite and mod_alias documentation and trying hundreds of examples... it still doesn't work!
What I try to solve is, when user enter address of some specific subdomain:
XXXXXXX.example.com
He sees content that is actually under
www.domain.com/tag/XXXXXXX/
but he is not redirected or URL isn't changed -- it should just stay XXXXXX.example.com as he enters.
I need to resolve this with Apache VirtualHost and sites-enabled file (not with SubdomainListener) but the most I can solve on my own with mod_rewrite is having
XXXXXXX.example.com
Rewriting (transparently) itself to
XXXXXXXX.example.com/tag/XXXXXXXX or
XXXXXXXX.example.com/app.php/tag/XXXXXXXX/
which of course is not what I try to achieve. I try to achieve internal (http://httpd.apache.org/docs/2.2/rewrite/remapping.html) redirection so user don't see that. Any help with working soultions would be otherworldly appreciated.
Since this commit, you can use subdomains in Symfony natively, but unfortunately it's a Symfony 2.2 feature. If you need subdomains, this still is the best way to do this, however.

Magento and urlencoded urls

I have some links in google like this:
/%3Fcat%3D9%26dir%3Dasc%26limit%3D10%26mode%3Dlist%26order%3Dprice
which equals this link (urldecoded):
/?cat=5&dir=desc&order=price&p=2
If we go by url http://my-shop.com/%3Fcat%3D9%26dir%3Dasc%26limit%3D10%26mode%3Dlist%26order%3Dprice, then Magento shows us 404 error
How can i get Magento redirect those bad urls to their respective urldecoded correct urls?
Magento version 1.7.0.2
Thanks for your time
The problem is the url, not the redirect. I hope this is clear? You have to remove this urls from your shop and from google.
After that, I don't think, there is a good way to do this, because you try to fix an uncommon error.
The magento way might be adding rules to the htaccess or adding the rule to the Magento internal rewrite table, but both solutions don't handle generic rules or regex, which solves this (with the htaccess I'm not sure).
So, I would fix the "bad url creation" problem and hack the index.php at the beginning, check wether such an url is requested, decode it and redirect to the page, die();

how to transfer codeigniter site from localhost to live server

I developed a site in codeigniter with basic functionality now i want to update this site to my live server. But when i uploaded my site to live server it shows 404 - PAGE NOT FOUND.
http://www.nawtist.com/test/ams/
Please tell me what do i need to do. I searched a lot about this but i didn't found any helpful information. So is there any base_url or anything else that i need to change before upload this on live server really appreciate
And remember, many servers are case-sensitive and with CodeIgniter v3 you should change the controller's first letter file and model's first letter file to upper case. That worked for me too.
Best
You have problem with your htaccess file or mod_rewrite is disable on that server.
When you go to page with index.php it works (although css file doesn't work because of bad routing)
also check if $config['index_page']=''; if it should work without index.php
I had the same problem times ago and there are 4 points in codeigniter to care about as I remember:
Check base_url value in your "config.php"
Check database settings in "database.php"
Check .htaccess file contents if you have defined it once
Check routes.php if you have defined any custom routes
That's all!
If you are facing 404 page not found in Codeigniter after upload file local to live server then follow these steps
change your controller and file name first letter capital
same change as above in model class and file name i.e first letter capital
After following steps above your problem can be solve Thank you.

Resources