How to rewrite PHP wesite url? - mod-rewrite

my website url is : http://localhost/kubas/?page=home or
http://localhost/kubas/index.php?page=home
I want to make http://localhost/kubas/home how to do that?

Remeber that the browser automatically looks for the INDEX page.
It would appear that your "home" is being pulled from another source, and being dynamically inserted into the INDEX page
If you want the HOME page to load without using the $_GET function to pull your home page "content", you will need to manually insert all of the HOME PAGE content into the INDEX.php page, from there you will need to insert the index page e.g. (index.php) into your HOME..."FOLDER".
The browser will then go to HOME folder, look for INDEX.php and vioala!

Related

New root page in wagtail

I want to change the Root page in Wagtail.
I have deleted the default home page
Created another page assigned "home" as slug.
Created a template my_page_name_home.html
But I am getting 404 all the time when I try http://localhost:8000/. Do I have to change the urls.py patterns?
I am doing this because of Wagtailtrans add-on. In order to work i have to redirect away from the homepage to my new page ot type TranslatableSiteRootPage
You need to go to Settings -> Sites in the Wagtail admin, and add a site record to associate 'localhost' to your new homepage. (A site record for this exists on the default installation, but this would have been deleted when you deleted the default homepage.)

URL rewrites not working and keep changing the URL extension

I cannot get the URL rewrite in Magento to work correctly at all. I'm trying to redirect a category to a CMS page and at first try it works fine. After I refresh, it starts to change the URL extensions to something completely different than what's shown for the category URL. I've tried clearing the cache and reindexing the URL rewrite but that seems to change it again!
And if I do try to change the URL rewrite to this new, random, made up one that's being automatically inputted - it changes it again! I'm so confused here..
Fixing weird URL Rewrites
Sometimes when you make changes to your products, or enable a certain extension, Magento might start to rewrite all your URLs to include a suffix "-1" or some other number. Within the URL Rewrites, Magento differentiates between System URLs and Custom URLs. If the System URLs are broken like this, you should not fix this by adding new Custom URLs.
Instead, open up phpMyAdmin, create a backup of your Magento database, and flush the Magento table core_url_rewrite (so that it becomes totally empty). Immediately afterwards, refresh the Catalog Url Rewrites under Index Management. This will regenerate all System URLs.
You can also try to redirect through the .htaccess.
Redirect 301 /site-URL-to-redirect www.site.com/url-destination
There are two ways to redirect your category page to cms.
Using Magento native URL rewrite managment.
In Magento 1.x go to
admin -> catalog -> url rewrite managment -> add new url
select custom in Create URL Rewrite: drop down and then give your categoy url as request and cms page as target.
Using .htaccess file. Add this line of code into the file .htaccess:
Redirect category-url cms-page-url

Magento wysiwyg editor insert variable in static block not working

When I use the editor in the CMS, I tried use the "Insert Variable" button in both show and high editor state and also edit html source.
I entered Link to Base URL.
If my base url is http://example.com, it is supposed to chagne http://example.com/abc,
but it shows me the same Link to Base URL in the frontend, how can I successfully get the true URL.
P.S. I got something like this in the 'edit html source' button:
Testing, but in the frontend it still show me back Link to Base URL
Try this way to add base url in your static block:
Link to Base URL
That should create a link to your store's base URL.

Joomla - Use index.php instead of "/" as homepage

Let:
test.tld = domain
test.tld/index.php = my Joomla home page
test.tld/ = a pre-release page (index.html) that isn't Joomla
Now Joomla always wants to go to test.tld/ as homepage so I basically get lost (because it isn't Joomla)
How to set Joomla so that the Menu to homepage is "test.tld/index.php" not assume I want "test.tld/" ?
I already tried making a dummy homepage on an invisible menu so that the "home" on the navigation isn't really a "home"
Is there no better way? Thanks
You can solve this issue in two ways:
Recommended: Your web-server default index is set to index.html file. You can change that based on your web-server (Apache, Nginx, whatever).
NOT Recommended: You can disable Rewrite URLs feature in Global Configuration of your site, this will show index.php on every page.

Renaming index.php and accessing other pages in Joomla

I have to do some modifications online on my website, and I don't want the users to see those pages. So I renamed index.php to index_orig.php and I put another index.html that show a message (WebSite under construction) for my users.
My problem is that I want to access online to the rest of my pages to check the modifications until satisfaction, but when I try to access the rest of the pages by their whole URL (404 error is shown).
Example : www.mywebsite.com/floder1/pagetarget.php.
Put back index.php.
In your global configuration, set the site to offline and put up a message and a logo etc (assuming you are on 2.5 or 3). You'll be able to login and see the site.
Please keep in mind that in a database driven cms there are not pages in the way that you would think of them in a static html site. Everything gets pushed into the index.php of your template file.
Update the directory default document on whatever webserver you are using. Also update any rewrite rules that may be pointing to index.php

Resources