wordpress wpml plugin - problem in language switching - php

I'm using the wamp package(Apache server) in my windows xp. After i followed the steps in the url click here i'm not able to access the different language. The problem i'm facing in the .htaccess file. under the www folder i put all my wordpress files in the name wsa26-4. So the file structure will come like this wamp/www/wsa26-4/wordpress files. So i used the following code in my htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wsa26-4/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
But the problem i was facing is when i click the language switcher flag say german then it's redirecting to me the default wamp server page.(http://localhost/wsa26-4/de-->localhost index page).. How i can fix this issue??

It's difficult to debug the .htaccess file like this.
What I always do is go to WordPress->Settings->Permalinks and save from there. Then, either WP can update the .htaccss file itself or it gives me the text to paste in.
In order for WPML to use languages in directories, 'fancy permalinks' need to work. You should test it first without WPML. Set a permalink structure such as 'Month / Day / Postname' and see that it works. For this, the server's rewrite module should work.
The .htaccess file needs to have the rewrite engine enabled (see the IfModule declaration). You should check if your local Apache server has this module enabled and if not, enable it.
Then, when this is OK, you can safely enable WPML's language directories option and it should run without any issues.

Related

Installing Drupal 8.2.4 - Clean URLs

So I have attempted to install Drupal 8.2.4 onto a dedicated server that I own.
I am running WampServer 3.0.4 64-bit with PHP 5.6.19 and MySQL 5.7.11.
I successfully get through the installation wizard and to the main page of the website however when I try to go to various pages, none of them work.
This appears to be an issue with Clean URLs. During the installation I get a warning message that Clean URLs is not enabled.
However, I have checked my apache config and rewrite_mod is enabled.
I tried to manually access the admin page # ?q=admin/config/search/clean-urls however it just returns me to the index page.
I've taken a look over the guide here: https://www.drupal.org/node/15365
I tred modifying my httpd.conf by adding the following to the bottom:
RewriteEngine on
RewriteBase /mms-beta
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
However, then the server won't start.
I've also ensured that for /www/ the AllowOverride is set to All for the purposes of htaccess.
Can someone give me an idea as to what I need to do to get this to work?
UPDATE: So I tried adding garbage to my .htaccess file and it doesn't break, so its clear my htaccess file is not even being read.
Ok, solved.
You need to add an alias under Apache through the wamp tray icon and then modify the conf file.
In the conf file specify as follows:
AllowOverride All
Then delete:
require local
Now htaccess will work correctly.

htaccess friendly URL rewrite rule

I have recently change my hosting and i need a htaccess rewrite rule for my files. I tried many examples but no one really works for my case. I have never been really good in htaccess and on my older hosting i didn't really need anything it just worked but here is not. Basically i want that my PHP files are without extensions and treated like a directory. So for example i have a URLs like these:
www.domain.com/file1/{id}/{nick}
So for example:
www.domain.com/myfile1/104/username
www.domain.com/myotherfile/455/nick
File1 in this case is a PHP file and {id} and {nick} are changable. I have this structure on my entire site for many other PHP files etc. So if possible i want one universal rule for all files. I tried with htaccess to remove php extenstion etc but all I got is 404 error. Also URL in browser should stay friendly without PHP extension. So in my case if i rewrite my URL manually in:
www.domain.com/file1.php/{id}/{nick} it worked but i don't want to change all the links etc on my website. So all i want is to hide PHP extension and treat PHP files as directory.
Thanks
You can use this single and generic front controller rule in site root .htaccess:
AcceptPathInfo On
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([\w-]+)/(.*)$ $1.php/$2 [L]

.htaccess rewrite on $page

It seems I am stuck. I have found answers, but I can't get them to work.
I am working on this website. I use a switch to determine what content should be visible. I use the variable $page.
The links with this method are not good for SEO so I want them to be /example instead of index.php?page=example.
I have looked at all the different answers to this on StackOverflow, but I can't get any solutions to work. There are no errors coming up and the site will show just fine, but the rewrite doesn't work.
I have tried on both my servers on servage.net and one.com
Any suggestions? :D would be much appreciated!
Try adding this to the .htaccess file in your web document root folder (often public_html or htdocs), then point your browser to example.com/somepage:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^./]+)/?$ page=$1 [L,R]
Once you are satisfied that the redirect works, you can change the R to R=301 to make it permanent.
This assumes that mod_rewrite is both installed and activated for htaccess files.
If you are not sure, to check if mod_rewrite is installed, look at the list of installed modules in the output of phpinfo();
By default, mod_rewrite is not enabled for htaccess files. If you are managing your own server, open httpd.conf
and make sure that the webroot directory block contains one of these lines: AllowOverride FileInfo or AllowOverride All

IIS6 Codeigniter IIRF Rewrite

I have an application written in Codeigniter 2.1.4 which works on my local machine installed with WAMP.
When moving the project over onto a production server, Codeigniter routing stops working. The login form actions a controller method, but instead I get routed to the home page of the website. The same happens if I manually try to enter any part of the web app, even though I have redirect logic for not being logged in to the app.
My production server has IIS6 installed and IsapiRewrite4.
I've tried copying all the rewrite rules from the .htaccess file that comes with CodeIgniter into an IIRF.INI file but I just can't get it to work.
These are the default .htaccess rules:
RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
I've read that you can paste that into an IIRF.INI file and it should work but had no luck with it.
Also, I'm not exactly sure where to put the IIRF.INI file, I was guessing at the CodeIgniter root directory where the other .htaccess is.
I also noticed that there are other .htaccess files, one in the /core folder, one in the /application folder, and one in the /application/cache folder.
Do I need to restart IIS on the production server when changing/adding IIRF.INI files?
I've also tried the rules suggested here with no luck: Configure htaccess to work with IIRF on IIS6 - codeigniter
Can anyone help??? Maybe it's not even a Rewrite Issue, I'm not sure... Please let me know if you need any other information.
Isapi Rewrite is a product by Helicon Tech. Helicon products use slightly different configuration files to Ionic IIRF isapi rewrite module which uses the IIRF.ini files. I think you've got your products mixed up.
See Helicon's documentation at http://www.helicontech.com/isapi_rewrite/
Alternatively Ionic ISAPI rewrite module is available at https://iirf.codeplex.com/

How do I configure pretty urls on my WordPress blog?

I am new to Wordpress (and PHP). I am trying to make WP MVC's sample run on my wordpress:
http://wordpress.org/extend/plugins/wp-mvc/
I added the plugin and can see data listed in my events menu but when I click View, it tries to browse:
http://localhost/mysite/events/1
and it can't I get 404 error and I suspect it is most probably due the fact that Wordpress is not configured for pretty urls.
So I went in my admin site and under Settings/Permalinks I selected 2nd option of Day and name and I still get 404 error. Also on my home pages my posts disappeared and I get:
Apologies, but the page you requested could not be found. Perhaps searching will help.
Has anybody had any experience with WP MVC?
PHP is making my head hurt:(
I am not a PHP guy but can try going into your httpd.conf and see if your rewrite module is commented or not. If there is any # in front of it remove it and then restart wamp and try. I think this is mostly due to the fact that your module is not enabled. Let me know if it helped you.
Specifically this line:
LoadModule rewrite_module modules/mod_rewrite.so
Make sure there is no # in front of it.
When you set a permalink structure in Settings > Permalinks, WordPress attempts to write an .htaccess file to the root of your site, probably similar to this default:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
My file permissions are locked down a bit tighter than that, so I see the suggested contents at the bottom of the Permalink page, with some brief instructions. Are you seeing something similar? Did WordPress create an .htaccess file? Do you have mod_rewrite installed? (I don't recall if WordPress can autodetect mod_rewrite.)

Categories