Joomla URL: Using format: www.xyz.com/section/category/article - joomla-sef-urls

I'm new to Joomla, and have switched on SEF URLs. However, the issue is that it returns my links in the format:
www.site.com/category/article
I'd like it to return articles in the format:
www.site.com/section/category/article
I've searched Stack Overflow and haven't found the answer...wondering if anyone could help.
Thanks in advance.

Like I've read at http://docs.joomla.org/SEF_URLs_in_Joomla!_1.5 you had to change the htaccess.txt to .htaccess. This is clear, because the URL-format is formatted with the mod_rewrite module.
If you want to do it by yourself, I recommend you reading http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html and learn how to use ReWrite-Rules. Then you can customize your URLs how you like.
The Rewrite-Rules are in the .htaccess file.

Related

Why doesn't Google recognise my PHP-generated sitemap.xml file?

I'm generating a simple XML sitemap with PHP and use a .htaccess rewrite the 'turn' that file into a .xml file. When I try to submit it to Google, Google gives me an non-descriptive error that I can't load the sitemap.
Here's the file: https://www.densediscovery.com/feed/sitemap/sitemap.xml
Does anyone have any ideas why it's not accepting it? Any other ideas for generating one (with PHP) that is acceptable?
This is probably because your webserver doesn't recognize .xml as an extension of files that should contain PHP code.
Google is not working like that, you just point to an XML file. (Not a file that changed the name to look like XML).
You need a PHP that generate a file let's say myXML.xml
How to generate XML file dynamically using PHP?
Then you add the URL of myXML.xml in Google.
If it looks too complicated you can use any online tool to generate a sitemap

htaccess ReWriteRule strip URL

I am looking for a bit of help, i'm new to using .htaccess files and i'm trying to take my currently URL (below)
www.domain.co.uk?referrer=firstname&surname&age&email&DPECODE
and replace it with a more concise version.
www.domain.co.uk/
The issue is whilst trying to find an answer it refers to use a fixed word within the url which i won't have, as it will be a different URL each time.

htaccess redirect ip/~folder to /var/zpanel/hostdata/zadmin/public_html/folder folder

I am a newbie in the .htaccess language and I would like to achieve the following thing: When an user types an http://ZPANEL-IP/~Website it will show him the contents of the /var/zpanel/hostdata/zadmin/public_html/Website folder. I tried doing that using RewriteCond, but didn't manage to do it, how can I achieve it, and if I do the code, where should I put it? Into Apache's default htacces or into the zpanel's htaccess configuration file?
Thanks in advance.

Apache URL Redirect Alternatives

One of my clients (before I came along) decided to use htaccess redirects as their form of URL shortening/search engine friendly URLs. They have literally thousands of them.
The new version of the site now has friendly urls but they aren't equivalent to their redirects so they still need them.
My question to you all is: Is there another way than to populate this file with thousands of lines of "Redirects /folder1 /folder2"?
Thanks
If you cannot make simple rules to catch all of them as in the #chris henry solution you can use the RewriteMap utility of mod_rewrite. You'll be able to write these thousand rules in a text file, then make this text file an hash file, and mode_rewrite will try to match url in this file (if it's an hash file it's quite fast). After that mode_rewwrite can generate a redirect 301 with the [L,R=301] tag.
Yep, look at using the Apache config (httpd.conf or httpd-vhosts.conf) to set up site wide folder aliasing. Eg:
Alias /folder1 c:/www/folder2
Look at http://httpd.apache.org/docs/2.0/mod/core.html#directory for more info.
Depending on how different the URLs being redirected are, one solution might be to come up with an rewrite rule that covers all of them, and maintain the short / long URLs in your application, or even a database.

How does Code Igniter know that index.php is not a directory?

My Code Igniter app has urls like this:
http://servername/contexttroot/index.php/Sessions/login/
My question is, when the url is parsed how does Apache know that there isn't a folder called index.php? If I were the parser, that's what I would be looking for :)
I know it works and CI's index.php gets called but I don't understand how this works. Maybe dots aren't allowed as part of directory names?
UPDATE See the comments on the accepted question for details, there are lots of details to what I am asking.
CodeIgniter basically performs rewrites of the URL by searching for the index file name "index.php" in your URL. Look in CI's config file for this line:
$config['index_page'] = "index.php";
Try changing that to something else and see if it still works.
Edit: OK, to answer the question Juan posed, the way Apache knows that index.php isn't a directory is because a file and directory can't have the same name in the same directory. If index.php were simply a directory, Apache would go into it and search further. If it is a file, it will run the file.