使用PHP SEO友好的URL为动态阿拉伯语分类网址 [英] SEO Friendly URL to Dynamic Arabic Category URL using PHP

查看:147
本文介绍了使用PHP SEO友好的URL为动态阿拉伯语分类网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有一个这样的网址

Currently I have a url like this

域/ index.php的?猫=مال_وأعمال

domain/index.php?cat=مال_وأعمال

我想设置的东西,使我们的营销人可以发布URL的喜欢

I want to set things up so that our Marketing people can publish url's like

域/مال_وأعمال

domain/مال_وأعمال

我已经尝试了几种解决方案,包括:

I've tried several solutions including:

mod_rewrite的 - 这种方法的问题是,它变成一个巨大的.htaccess文件,因为我们需要写每类规则

mod_rewrite - the problem with this approach is that it becomes a huge .htaccess file since we need to write a rule for each category.

RewriteMap指令 - 这次来到pretty的接近,因为我可以查询到建立映射文件输出数据库。不过,我后来才知道,我们没有获得的httpd.conf。

RewriteMap - this came pretty close since I could query the database to build map file for output. However, I've since learned we don't have access to httpd.conf.

的index.php - 我已经尝试运行通过我们这工作index.php文件的一切,但不留网址在浏览器友好的搜索引擎优化的目的

index.php - I've tried running everything through our index.php file which works, but doesn't keep the URL in the browser friendly for SEO purposes.

我希望有人有另外一种想法可能的帮助,我真的AP preciate它。如果你已经有了一个参考的东西在网络上,这将有助于这将会是巨大的。

I'm hoping somebody has another idea which might help, I'd really appreciate it. If you've got a reference to something on the web that would help that'd be great too.

PHP的.htaccessmod-rewriteSEO友好

php .htaccess mod-rewrite seo-friendly

推荐答案

您可以使用下面的规则来映射每个请求的URI路径中只包含一个路径段上的的index.php 的同时,除现有的文件:

You can use the following rule to map every request that’s URI path does only contain a single path segment onto the index.php while excluding existing files:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^[^/]+$ index.php?cat=$0 [L]

请注意,您确实有要求 /مال_وأعمال有它在内部重写为 /index.php?cat=مال_وأعمال

Note that you actually have to request /مال_وأعمال to have it internally rewritten to /index.php?cat=مال_وأعمال.

这篇关于使用PHP SEO友好的URL为动态阿拉伯语分类网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆